-
-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[18.0][MIG] base_technical_features: Migration to 18.0 #953
[18.0][MIG] base_technical_features: Migration to 18.0 #953
Conversation
Using new base model inheritance
Currently translated at 75.0% (6 of 8 strings) Translation: server-ux-11.0/server-ux-11.0-base_technical_features Translate-URL: https://translation.odoo-community.org/projects/server-ux-11-0/server-ux-11-0-base_technical_features/ar/
Currently translated at 75.0% (6 of 8 strings) Translation: server-ux-11.0/server-ux-11.0-base_technical_features Translate-URL: https://translation.odoo-community.org/projects/server-ux-11-0/server-ux-11-0-base_technical_features/da/
Currently translated at 100.0% (8 of 8 strings) Translation: server-ux-11.0/server-ux-11.0-base_technical_features Translate-URL: https://translation.odoo-community.org/projects/server-ux-11-0/server-ux-11-0-base_technical_features/es/
Currently translated at 100,0% (8 of 8 strings) Translation: server-ux-11.0/server-ux-11.0-base_technical_features Translate-URL: https://translation.odoo-community.org/projects/server-ux-11-0/server-ux-11-0-base_technical_features/ca/
Currently translated at 100.0% (8 of 8 strings) Translation: server-ux-12.0/server-ux-12.0-base_technical_features Translate-URL: https://translation.odoo-community.org/projects/server-ux-12-0/server-ux-12-0-base_technical_features/it/
Currently translated at 100.0% (8 of 8 strings) Translation: server-ux-12.0/server-ux-12.0-base_technical_features Translate-URL: https://translation.odoo-community.org/projects/server-ux-12-0/server-ux-12-0-base_technical_features/it/
Currently translated at 100.0% (8 of 8 strings) Translation: server-ux-12.0/server-ux-12.0-base_technical_features Translate-URL: https://translation.odoo-community.org/projects/server-ux-12-0/server-ux-12-0-base_technical_features/pt/
Currently translated at 100.0% (8 of 8 strings) Translation: server-ux-12.0/server-ux-12.0-base_technical_features Translate-URL: https://translation.odoo-community.org/projects/server-ux-12-0/server-ux-12-0-base_technical_features/zh_CN/
Currently translated at 100.0% (8 of 8 strings) Translation: server-ux-12.0/server-ux-12.0-base_technical_features Translate-URL: https://translation.odoo-community.org/projects/server-ux-12-0/server-ux-12-0-base_technical_features/pt_BR/
Currently translated at 87.5% (7 of 8 strings) Translation: server-ux-12.0/server-ux-12.0-base_technical_features Translate-URL: https://translation.odoo-community.org/projects/server-ux-12-0/server-ux-12-0-base_technical_features/hr/
Currently translated at 100.0% (8 of 8 strings) Translation: server-ux-12.0/server-ux-12.0-base_technical_features Translate-URL: https://translation.odoo-community.org/projects/server-ux-12-0/server-ux-12-0-base_technical_features/hr/
Currently translated at 100.0% (8 of 8 strings) Translation: server-ux-14.0/server-ux-14.0-base_technical_features Translate-URL: https://translation.odoo-community.org/projects/server-ux-14-0/server-ux-14-0-base_technical_features/es/
Currently translated at 100.0% (8 of 8 strings) Translation: server-ux-14.0/server-ux-14.0-base_technical_features Translate-URL: https://translation.odoo-community.org/projects/server-ux-14-0/server-ux-14-0-base_technical_features/nl/
Currently translated at 100.0% (8 of 8 strings) Translation: server-ux-16.0/server-ux-16.0-base_technical_features Translate-URL: https://translation.odoo-community.org/projects/server-ux-16-0/server-ux-16-0-base_technical_features/es/
Currently translated at 100.0% (8 of 8 strings) Translation: server-ux-17.0/server-ux-17.0-base_technical_features Translate-URL: https://translation.odoo-community.org/projects/server-ux-17-0/server-ux-17-0-base_technical_features/it/
…sers On databases with a large number of users, loading all users of base.group_no_one can be slow. Moreover, the 'technical_features' and 'show_technical_features' are always computed for a single record
/ocabot migration base_technical_features |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks :) Some comments below
"""Set debug = True, so that group_no_one is not filtered out of the | ||
user's groups""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the docstring available from this commit: 204294
def user_has_groups(self, groups): | ||
"""Return True for users in the technical features group when | ||
membership of the original group is checked, even if debug mode | ||
is not enabled. | ||
@api.model | ||
def _get_view(self, view_id=None, view_type="form", **options): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it enogh to just replace the group in view?
arch, view = super()._get_view(view_id=view_id, view_type=view_type, **options) | ||
arch_str = etree.tostring(arch, encoding="unicode") | ||
arch_str = arch_str.replace( | ||
"base.group_no_one", "base_technical_features.group_technical_features" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this would be more correct, as otherwise a user with no base_technical_features.group_technical_features
wouldn't access to the regular base.group_no_one
behavior in debug mode
"base.group_no_one", "base_technical_features.group_technical_features" | |
"base.group_no_one", "base.group_no_one,base_technical_features.group_technical_features" |
ac44d8d
to
6de17cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG overall, minor remark.
@chienandalu good for you?
@api.model | ||
def _get_view(self, view_id=None, view_type="form", **options): | ||
arch, view = super()._get_view(view_id=view_id, view_type=view_type, **options) | ||
arch_str = etree.tostring(arch, encoding="unicode") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't be better to check if the string is there 1st?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
/ocabot merge nobump |
Hey, thanks for contributing! Proceeding to merge this for you. |
This PR has the |
Congratulations, your PR was merged at 4b35eea. Thanks a lot for contributing to OCA. ❤️ |
I found only 1 commit to port but it was ignored, I added it to blacklist: [17.0][FW] base_technical_features: port from 14.0
Reason for change:
The original logic in _postprocess_access_rights removes base.group_no_one for non-admin users, which restricts their access to certain UI components. Extending _get_view ensures that technical users (part of base_technical_features.group_technical_features) still have access to these components without needing full admin privileges.