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 = [(