Skip to content

Conversation

@lef-adhoc
Copy link
Contributor

@lef-adhoc lef-adhoc commented Oct 23, 2025

@lef-adhoc lef-adhoc force-pushed the 19.0-mig-sale_triple_discount branch 5 times, most recently from af79003 to a3fe9ea Compare October 23, 2025 15:44
Copy link
Contributor

@ferran-S73 ferran-S73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review

@lef-adhoc
Copy link
Contributor Author

@sbejaoui Hi, could you check this PR?

tafaRU and others added 21 commits November 21, 2025 14:13
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/
[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
Ivorra78 and others added 19 commits November 21, 2025 14:13
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
add an inverse to the standard discount field, which resets the three
discounts and sets discount1 with the value coming from the inverse.
this way, any standard process like pricelists will integrate with this
logic out of the box, without extra customization
@dreispt
Copy link
Member

dreispt commented Jan 4, 2026

/ocabot migration sale_triple_discount

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Jan 4, 2026
Copy link
Contributor

@Reyes4711-S73 Reyes4711-S73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Alexgars73
Copy link
Contributor

@lef-adhoc could you change the class text-right to text-end? text-right is obsolete and has no effect. Thanks!

@lef-adhoc lef-adhoc force-pushed the 19.0-mig-sale_triple_discount branch from 7db7948 to cc16164 Compare January 21, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.