Call on_change_product only if the sale line has been changed

Since f41c9c208d39 the _changed_values is a method instead of a property.

Closes #15013
(grafted from 80f38dd8024d1e471f7c1569ba1b36c87185f7cc)

--HG--
branch : 8.0
This commit is contained in:
Cédric Krier
2026-08-14 18:11:42 +02:00
parent ad81e44df6
commit a5ac7f8cfa
+2 -2
View File
@@ -951,7 +951,7 @@ class Line(IdentifierMixin, metaclass=PoolMeta):
line._set_shopify_shipping_product(sale, shipping_line)
setattr_changed(line, 'quantity', 1)
if line.product:
if line._changed_values:
if line._changed_values():
line.on_change_product()
else:
setattr_changed(line, 'taxes', ())
@@ -978,7 +978,7 @@ class Line(IdentifierMixin, metaclass=PoolMeta):
line.product = None
line._set_shopify_refund_product(sale)
setattr_changed(line, 'quantity', -1)
if line._changed_values:
if line._changed_values():
line.on_change_product()
unit_price = round_price(Tax.reverse_compute(
amount, line.taxes, sale.sale_date))