-
-
Notifications
You must be signed in to change notification settings - Fork 282
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
[15.0][IMP] partner_multi_company: prevent inconsistencies between user and partner #667
[15.0][IMP] partner_multi_company: prevent inconsistencies between user and partner #667
Conversation
d0139c7
to
b219e53
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.
@ArnauCForgeFlow Functional review
There is an issue when creating a new company, the constraint raises and it is blocked:
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.
After discussion, the problem is only due to demo data coming from different modules. It is a status impossible to reach in a blank database.
Therefore, LGTM 👍
/ocabot merge nobump |
Hey, thanks for contributing! Proceeding to merge this for you. |
@JordiBForgeFlow your merge command was aborted due to failed check(s), which you can inspect on this commit of 15.0-ocabot-merge-pr-667-by-JordiBForgeFlow-bump-nobump. After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red. |
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.
Standard doesn't put any company to the partners of the users. Why changing the strategy?
|
||
def migrate(cr, version): | ||
env = api.Environment(cr, SUPERUSER_ID, {}) | ||
for user in env["res.users"].search([]): |
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.
Don't duplicate code. Just import with from ...hooks import post_init_hook
and call it 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.
Good remark
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.
Done!
11625f4
to
59d8794
Compare
@pedrobaeza let us know if it looks good to you now |
59d8794
to
4ccab03
Compare
4ccab03
to
950c28e
Compare
Hi @pedrobaeza Does it looks better now? Could you update your review? Thanks! |
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
Please fw-port it to upper versions.
@@ -0,0 +1,10 @@ | |||
# Copyright 2024 ForgeFlow S.L. (http://www.forgeflow.com) |
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.
Double copyright
# pylint: disable=W7950 | ||
from odoo.addons.partner_multi_company import hooks |
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.
# pylint: disable=W7950 | |
from odoo.addons.partner_multi_company import hooks | |
from ...hooks import fix_user_partner_companies |
and change the call
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.
This is not critical, so I launched the merge command.
On my way to merge this fine PR! |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at e2de769. Thanks a lot for contributing to OCA. ❤️ |
This improvement prevent some inconsistencies between user and partner company_ids
The change on the res_company_code was needed in order to pass odoo tests