From d897c738524f065f293fde32524bb59b2d4372ea Mon Sep 17 00:00:00 2001 From: "Anh Thao Pham (pta)" Date: Tue, 17 Nov 2020 13:21:52 +0000 Subject: [PATCH] [FIX] account: fix 0% taxes shown on invoice print - Install Invoicing - Go to Invoicing > Configuration > Taxes - Create a Tax 0% with its own tax group - Go to Invoicing > Customers > Invoices - Create an Invoice with a line having a normal Tax and several lines with Tax 0% - Confirm and print Invoice On the Subtotal section of the printed invoice, for the label of the Tax Group of Tax 0%, only the amount of the first line having this tax is shown. (i.e. "Tax 0% on $ XXX", where XXX should be the sum of all lines on which Tax 0% is applied) opw-2381051 closes odoo/odoo#62106 X-original-commit: 9e244ae3053f46fc22b8e9a75015d57cd70053b8 Signed-off-by: Anh Thao PHAM --- addons/account/models/account_move.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 1a4766fc957..6d9a2400e9a 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1486,11 +1486,13 @@ class AccountMove(models.Model): # At this point we only want to keep the taxes with a zero amount since they do not # generate a tax line. + zero_taxes = set() for line in move.line_ids: for tax in line.tax_ids.flatten_taxes_hierarchy(): - if tax.tax_group_id not in res: + if tax.tax_group_id not in res or tax.tax_group_id in zero_taxes: res.setdefault(tax.tax_group_id, {'base': 0.0, 'amount': 0.0}) res[tax.tax_group_id]['base'] += tax_balance_multiplicator * (line.amount_currency if line.currency_id else line.balance) + zero_taxes.add(tax.tax_group_id) res = sorted(res.items(), key=lambda l: l[0].sequence) move.amount_by_group = [(