From 6783087ac487846d5151691ca44897273d893c16 Mon Sep 17 00:00:00 2001 From: josseossa <32182869+josseossa@users.noreply.github.com> Date: Tue, 24 Sep 2024 09:23:29 -0400 Subject: [PATCH] Add update to the case it's a new invoice --- sale_discount_total/models/account_invoice.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sale_discount_total/models/account_invoice.py b/sale_discount_total/models/account_invoice.py index 41d8d678d..1e94d8b2a 100644 --- a/sale_discount_total/models/account_invoice.py +++ b/sale_discount_total/models/account_invoice.py @@ -60,7 +60,10 @@ class AccountInvoice(models.Model): 'line_ids.payment_id.state', 'line_ids.full_reconcile_id') def _compute_amount(self): - super(AccountInvoice, self)._compute_amount() + try: + super(AccountInvoice, self)._compute_amount() + except NameError: + pass for move in self: total_untaxed, total_untaxed_currency = 0.0, 0.0 total_tax, total_tax_currency = 0.0, 0.0