From bd74461b7b33b8322c7b14fb991b59dac5bfe0ce Mon Sep 17 00:00:00 2001 From: josseossa <32182869+josseossa@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:40:14 -0400 Subject: [PATCH 1/2] Update account_invoice.py The module is breaking any other module that calls the _compute_amount method on account_move. I'm adding the line that fix that issue. --- sale_discount_total/models/account_invoice.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sale_discount_total/models/account_invoice.py b/sale_discount_total/models/account_invoice.py index 3db4746cc..41d8d678d 100644 --- a/sale_discount_total/models/account_invoice.py +++ b/sale_discount_total/models/account_invoice.py @@ -60,6 +60,7 @@ class AccountInvoice(models.Model): 'line_ids.payment_id.state', 'line_ids.full_reconcile_id') def _compute_amount(self): + super(AccountInvoice, self)._compute_amount() for move in self: total_untaxed, total_untaxed_currency = 0.0, 0.0 total_tax, total_tax_currency = 0.0, 0.0 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 2/2] 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