From 86221d1f714bc9f1ea39e672d6dca384d2f209aa Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Tue, 4 Aug 2020 06:56:17 +0000 Subject: [PATCH] [FIX] account: show taxes when they are zero on invoices print MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, the taxes with amount of zero are not shown on invoice print. For instance, the 15% tax of a product with value of €0.01 will not be show on invoice print. This previous commit 37a0f7acae8aebef35577b178f8aeefed11c9105 allows showing zero percent taxes on invoice print. This commit, will fine-tuning the previous commit to also show taxes with zero amount. opw-2307761 closes odoo/odoo#55665 X-original-commit: b8bb1e12a10477bb31addc6d3cecefa046dd09fe Signed-off-by: Jorge Pinna Puissant (jpp) Signed-off-by: Nicolas Lempereur (nle) --- addons/account/models/account_move.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index c66f9728b0e..dd621a06853 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1402,9 +1402,10 @@ 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. for line in move.line_ids: - for tax in line.tax_ids.flatten_taxes_hierarchy().filtered(lambda t: t.amount == 0.0): - 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) + for tax in line.tax_ids.flatten_taxes_hierarchy(): + if tax.tax_group_id not in res: + 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) res = sorted(res.items(), key=lambda l: l[0].sequence) move.amount_by_group = [(