-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
[16.0][FIX] base_multi_company: support in False
search operators
#760
[16.0][FIX] base_multi_company: support in False
search operators
#760
Conversation
Hi @pedrobaeza, |
Now that `base_multi_company` supports `('company_id', 'in', some_ids + [False])` domains since OCA#760, it's time to remove the (un)install hooks that changed those rules. The fix is important when migrating a database from previous versions where these hooks didn't exist. In those cases, users wouldn't be able to browse some partners, getting a weird `AccessError`. FWIW, [upstream rules changed for performance][2], so the uninstall hook had to be changed nevertheless. [2]: odoo/odoo@a04df5c#diff-1f2cafa0e26df218210181c72e599c279fd093c4215d1dc1da5ef8875195e6c2L23-R23 @moduon MT-8863
2805d27
to
d34f488
Compare
d34f488
to
6875f5a
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.
Code review here. LGTM!
Before this commit, when doing a read with a domain such as [the one used by upstream `base.res_partner_rule`][1], the read failed to find records without company. This is now fixed in the base module, adding tested support for such operators. The only relevant part of the hooks that were provided to workaround the issue is extracted to a new `post_init_hook`. All other hooks are marked as deprecated. [1]: https://github.com/odoo/odoo/blob/db072461cddced2a8f65a64fb6d2ddf0dd79b38e/odoo/addons/base/security/base_security.xml#L23 @moduon MT-8863 MT-8873
6875f5a
to
aee7d28
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.
Functional review done.
I have verified that both in the Products module
and in Contacts
it is allowed to select the companies we want for sharing.
LGTM!
Thanks @yajo
This module is already migrated to 17 and the is a PR for 18. @victoralmau @pedrobaeza @chienandalu could you review please? We can fordward port to all versions. Thank you! 😄 Note Odoo 18 migration #708 |
in False
search operatorsin False
search operators
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 major
On my way to merge this fine PR! |
Congratulations, your PR was merged at 93c447e. Thanks a lot for contributing to OCA. ❤️ |
Now that `base_multi_company` supports `('company_id', 'in', some_ids + [False])` domains since OCA#760, it's time to remove the (un)install hooks that changed those rules. The fix is important when migrating a database from previous versions where these hooks didn't exist. In those cases, users wouldn't be able to browse some partners, getting a weird `AccessError`. FWIW, [upstream rules changed for performance][2], so the uninstall hook had to be changed nevertheless. [2]: odoo/odoo@a04df5c#diff-1f2cafa0e26df218210181c72e599c279fd093c4215d1dc1da5ef8875195e6c2L23-R23 @moduon MT-8863
Before this commit, when doing a read with a domain such as the one used by upstream
base.res_partner_rule
, the read failed to find records without company.This is now fixed in the base module, adding tested support for such operators. The only relevant part of the hooks that were provided to workaround the issue is extracted to a new
post_init_hook
. All other hooks are marked as deprecated.Instructions for functional tests: This refactor is internal and should not be noticed functionally. The modules
product_multi_company
andpartner_multi_company
should work just as always. If so, then this is good.@moduon MT-8863 MT-8873