Skip to content
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] partner_multi_company: remove unnecessary rule rewrite hooks #761

Merged

Conversation

yajo
Copy link
Member

@yajo yajo commented Jan 29, 2025

Now that base_multi_company supports ('company_id', 'in', some_ids + [False]) domains since #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, so the uninstall hook had to be changed nevertheless.

Draft until:

Instructions for functional tests: This refactor is internal and should not be noticed functionally. The module partner_multi_company should work just as always. If so, then this is good.

@moduon MT-8863

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
@yajo yajo force-pushed the 16.0-partner_multi_company-remove_hooks branch from 82e3cfa to b51967d Compare February 12, 2025 09:23
@yajo yajo marked this pull request as ready for review February 12, 2025 09:23
@pedrobaeza pedrobaeza changed the title [FIX] partner_multi_company: remove unnecessary rule rewrite hooks [16.0][FIX] partner_multi_company: remove unnecessary rule rewrite hooks Feb 12, 2025
@pedrobaeza pedrobaeza added this to the 16.0 milestone Feb 12, 2025
@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@yajo
Copy link
Member Author

yajo commented Feb 14, 2025

This seems ready to merge @pedrobaeza

@pedrobaeza
Copy link
Member

/ocabot merge major

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-761-by-pedrobaeza-bump-major, awaiting test results.

@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 64527ea. Thanks a lot for contributing to OCA. ❤️

@OCA-git-bot OCA-git-bot merged commit 7c8670e into OCA:16.0 Feb 14, 2025
7 checks passed
@Shide Shide deleted the 16.0-partner_multi_company-remove_hooks branch February 18, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants