-
-
Notifications
You must be signed in to change notification settings - Fork 387
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
[MIG][15.0]crm_lead_vat: Migration V15 #420
Conversation
a1a834b
to
082e6e5
Compare
/ocabot migration crm_lead_vat |
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.
@moduon MT-518
crm_lead_vat/models/crm_lead.py
Outdated
from odoo.addons.crm.models.crm_lead import PARTNER_ADDRESS_FIELDS_TO_SYNC | ||
|
||
# Add vat in list | ||
PARTNER_ADDRESS_FIELDS_TO_SYNC += ["vat"] | ||
|
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 code is loaded when the module is scanned by Odoo, at boot.
🛑 Thus you shouldn't alter this global variable (actually a pseudo-constant, as stated by the UPPER_CASE name).
crm_lead_vat/models/crm_lead.py
Outdated
result = super(Lead, self)._prepare_values_from_partner(partner) | ||
if not partner: | ||
return result | ||
if partner.vat: | ||
result["vat"] = partner.vat | ||
result = super(Lead, self)._prepare_address_values_from_partner(partner) |
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.
Following from the above comment, you should undo this diff and leave it as it was before.
This way, we only alter the behavior when a database has the module installed, and not only when it is available.
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.
changes are done.
@bizzappdev are you going to continue with this PR? Thanks! 😄 |
def _prepare_address_values_from_partner(self, partner): Hello! |
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: crm-12.0/crm-12.0-crm_lead_vat Translate-URL: https://translation.odoo-community.org/projects/crm-12-0/crm-12-0-crm_lead_vat/
Currently translated at 100.0% (3 of 3 strings) Translation: crm-12.0/crm-12.0-crm_lead_vat Translate-URL: https://translation.odoo-community.org/projects/crm-12-0/crm-12-0-crm_lead_vat/pt_BR/
Currently translated at 100.0% (3 of 3 strings) Translation: crm-12.0/crm-12.0-crm_lead_vat Translate-URL: https://translation.odoo-community.org/projects/crm-12-0/crm-12-0-crm_lead_vat/it/
Currently translated at 100.0% (3 of 3 strings) Translation: crm-12.0/crm-12.0-crm_lead_vat Translate-URL: https://translation.odoo-community.org/projects/crm-12-0/crm-12-0-crm_lead_vat/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: crm-14.0/crm-14.0-crm_lead_vat Translate-URL: https://translation.odoo-community.org/projects/crm-14-0/crm-14-0-crm_lead_vat/
2bb42e1
to
05b7be2
Compare
05b7be2
to
f605f2c
Compare
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
No description provided.