-
-
Notifications
You must be signed in to change notification settings - Fork 868
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][MIG] partner_ref_unique: Migration to 16.0 #1495
Conversation
This contraint is self-disabled when it detects by context that it is being used from the contact deduplicator. Otherwise, the user cannot deduplicate a contact selecting the "good" one as the one without reference. Anyway, in these cases, the check has no meaning, since it is to avoid duplicates and in this context we are currently removing them.
- Added OCA icon
OCA Transbot updated translations from Transifex OCA Transbot updated translations from Transifex OCA Transbot updated translations from Transifex OCA Transbot updated translations from Transifex OCA Transbot updated translations from Transifex
Currently translated at 100.0% (8 of 8 strings) Translation: partner-contact-12.0/partner-contact-12.0-partner_ref_unique Translate-URL: https://translation.odoo-community.org/projects/partner-contact-12-0/partner-contact-12-0-partner_ref_unique/hr/
Before this commit, the partner_ref_unique could be changed on the company even if existing partners share the same internal ref. Therefore, errors will appear afterwards as DB already contains duplicates although the policy shouldn't allow it. With this change, the error will appear as soon as the policy is changed, so that the data must be fixed before activating the constraint.
…ompany Add pre_init_hook to speed up module installation
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: partner-contact-12.0/partner-contact-12.0-partner_ref_unique Translate-URL: https://translation.odoo-community.org/projects/partner-contact-12-0/partner-contact-12-0-partner_ref_unique/
Currently translated at 100.0% (8 of 8 strings) Translation: partner-contact-12.0/partner-contact-12.0-partner_ref_unique Translate-URL: https://translation.odoo-community.org/projects/partner-contact-12-0/partner-contact-12-0-partner_ref_unique/es/
Currently translated at 100.0% (8 of 8 strings) Translation: partner-contact-12.0/partner-contact-12.0-partner_ref_unique Translate-URL: https://translation.odoo-community.org/projects/partner-contact-12-0/partner-contact-12-0-partner_ref_unique/de/
If merging 2 contacts, one with reference, and another without, and being the target one the contact without reference, the constraint is raised as the reference value is copied before unlinking the other contact. We avoid it disabling the constraint when merging.
Currently translated at 100.0% (9 of 9 strings) Translation: partner-contact-15.0/partner-contact-15.0-partner_ref_unique Translate-URL: https://translation.odoo-community.org/projects/partner-contact-15-0/partner-contact-15-0-partner_ref_unique/ca/
@diogocsc did you add yourself into the contributor yet? |
/ocabot migration partner_ref_unique |
8b7f500
to
d0c7047
Compare
d0c7047
to
0d15ae1
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.
@diogocsc Next time, could you split pre-commit stuffs (like setup folder) in separate commit from migration changes as explained in https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-16.0 ?
Thanks
Will do @rousseldenis . Thanks for the feedback. |
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 OK
This PR has the |
ping @diogocsc |
Please check latest commit @RodrigoBM |
This PR has the |
/ocabot merge nobump |
What a great day to merge this nice PR. Let's do it! |
Good job! |
Congratulations, your PR was merged at 1523699. Thanks a lot for contributing to OCA. ❤️ |
No description provided.