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

[17.0][MIG] sale_triple_discount #3406

Open
wants to merge 44 commits into
base: 17.0
Choose a base branch
from

Conversation

dalonsod
Copy link

Standard migration.

Supersedes #3157 due to inactivity.

Pending tasks:

@rousseldenis
Copy link
Contributor

/ocabot migration sale_triple_discount

@ferran-S73
Copy link
Contributor

@dalonsod your pre-commit commit is modifying files from another module, is this intended? I think you should this, please remove these changes

@dalonsod
Copy link
Author

@ferran-S73 these changes (for addon sale_order_general_discount) were automatically added by pre-commit execution, I didn't notice it. It suggests that sale_order_general_discount doesn't fit current pre-commit standard. I can remove it without any problem for this PR, but IMO this should be permanently fixed in that addon anyway.

@ferran-S73
Copy link
Contributor

@ferran-S73 these changes (for addon sale_order_general_discount) were automatically added by pre-commit execution, I didn't notice it. It suggests that sale_order_general_discount doesn't fit current pre-commit standard. I can remove it without any problem for this PR, but IMO this should be permanently fixed in that addon anyway.

@dalonsod I agree it should be fixed if it needs fixing but I don't think it should be done in this PR and in the same commit as the changes from the module you are migrating

@dalonsod dalonsod force-pushed the 17.0-mig-sale_triple_discount branch 2 times, most recently from cc9a8a3 to 2aed0d7 Compare November 26, 2024 17:05
@dalonsod
Copy link
Author

@ferran-S73 done

tafaRU and others added 14 commits November 29, 2024 11:35
OCA Transbot updated translations from Transifex

[UPD] Update sale_triple_discount.pot
Currently translated at 100,0% (5 of 5 strings)

Translation: sale-workflow-10.0/sale-workflow-10.0-sale_triple_discount
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-10-0/sale-workflow-10-0-sale_triple_discount/nl_NL/
Currently translated at 100.0% (5 of 5 strings)

Translation: sale-workflow-10.0/sale-workflow-10.0-sale_triple_discount
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-10-0/sale-workflow-10-0-sale_triple_discount/nl_NL/
…onsistency

[FIX] sale_triple_discount: Invalidating the cache of specific records before recomputing price and discount

[UPD] Update sale_triple_discount.pot

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-10.0/sale-workflow-10.0-sale_triple_discount
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-10-0/sale-workflow-10-0-sale_triple_discount/
[UPD] Update sale_triple_discount.pot
[UPD] Update sale_triple_discount.pot

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_triple_discount
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_triple_discount/
ferran-S73 and others added 29 commits November 29, 2024 11:35
[UPD] Update sale_triple_discount.pot

[UPD] README.rst
Currently translated at 100.0% (11 of 11 strings)

Translation: sale-workflow-14.0/sale-workflow-14.0-sale_triple_discount
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-14-0/sale-workflow-14-0-sale_triple_discount/it/

[UPD] README.rst

[UPD] README.rst
Currently translated at 0.0% (0 of 11 strings)

Translation: sale-workflow-14.0/sale-workflow-14.0-sale_triple_discount
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-14-0/sale-workflow-14-0-sale_triple_discount/fr/
[UPD] Update sale_triple_discount.pot

[UPD] README.rst
Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-15.0/sale-workflow-15.0-sale_triple_discount
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-15-0/sale-workflow-15-0-sale_triple_discount/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_triple_discount
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_triple_discount/
Currently translated at 100.0% (12 of 12 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_triple_discount
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_triple_discount/es_MX/
Currently translated at 100.0% (12 of 12 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_triple_discount
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_triple_discount/it/
Currently translated at 100.0% (12 of 12 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_triple_discount
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_triple_discount/es/
Currently translated at 100.0% (12 of 12 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_triple_discount
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_triple_discount/it/
Currently translated at 100.0% (12 of 12 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_triple_discount
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_triple_discount/de/
Currently translated at 100.0% (12 of 12 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_triple_discount
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_triple_discount/pt_BR/
Method 'invalidate_cache' is deprecated. To invalidate specific field's value into the cache for a recordset we must use the 'invalidate_recordset' method on the recordset itself.
When computing the amount total on a sale.order.line, we now avoid to play with the cache since this change introduced in OCA@e3e59ba introduces a decline in performance. When the cache in invalidated, fields are flushed to the database and depending computed fields are recomputed..... This ultimately leads to temporary inconsistencies breaking others addons relaying on this one. Moreover, the method used in this original commit 'self.invalidate_cache(fnames=self._discount_fields(), ids=self.ids)' is deprecated and the use of the recommended new one lead to others side effects. The original approach is replaced by a contextual method modifying only the discount field when we need it's needed to don't break code relaying on the fact that the discount field is the total discount to apply to a line. This contextual method ensures that the original value is properly restored on exit and that it will not trigger additional recompute due to the temporary change of the discount value
@dalonsod dalonsod force-pushed the 17.0-mig-sale_triple_discount branch from 2aed0d7 to 41bdc2d Compare November 29, 2024 10:35
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.