[FIX] delivery: avoid retrospective computation

If we're to change the invoice policy of a product we'd provoke a
chained computation of every sale line and sale order containing such
product. This change goes along with the policy of applying such changes
only to future orders, as stated here: https://github.com/odoo/odoo/pull/61135

closes odoo/odoo#64641

X-original-commit: 806da3d67a5cf9919c6c0f5042b3e00c69825faa
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
david
2021-01-15 17:50:01 +00:00
committed by Martin Trigaux
parent e09fd75efd
commit 9e7c19d3d8
+1 -2
View File
@@ -122,8 +122,7 @@ class SaleOrder(models.Model):
post = u'\N{NO-BREAK SPACE}{symbol}'.format(symbol=self.currency_id.symbol or '')
return u' {pre}{0}{post}'.format(amount, pre=pre, post=post)
@api.depends('order_line.is_delivery', 'order_line.is_downpayment',
'order_line.product_id.invoice_policy')
@api.depends('order_line.is_delivery', 'order_line.is_downpayment')
def _get_invoice_status(self):
super()._get_invoice_status()
for order in self: