[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
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
|
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
|
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
|
Can you add these changes also to v17 so I can bring them also to v18 in #790? |
|
I'd love to, but right now I don't think I'll have the time to do so. Maybe maybe you can just fwport this to v18 directly? |
Ok, thanks for clarifying, I don't have time either. |


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_companyandpartner_multi_companyshould work just as always. If so, then this is good.@moduon MT-8863 MT-8873