From c1fea08517a6093945b5e70d764771ece2ded9aa Mon Sep 17 00:00:00 2001 From: "Andrea Grazioso (agr-odoo)" Date: Mon, 30 Dec 2019 10:00:52 +0000 Subject: [PATCH] [FIX] account: fix tax basis display on report Activate multicurrency. The default currency for the company should be USD. Make an invoice in EUR, with taxes, save and create the invoice. The tax section will display the correct tax amount but the displayed amount on which the tax should be applied is wrong: it's displayed the amount in the company currency rather than the invoice currency. Adding a _convert step to restore the correct currency since that information does not appear to be saved in the database opw-2161039 closes odoo/odoo#42494 X-original-commit: f9a8015ef8231a23cf8e5552c08248cfc95e977c Signed-off-by: Nicolas Martinelli (nim) --- addons/account/models/account_move.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 9705b600e32..a96c8cc0222 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1272,8 +1272,12 @@ class AccountMove(models.Model): res[line.tax_line_id.tax_group_id]['amount'] += line.price_subtotal tax_key_add_base = tuple(move._get_tax_key_for_group_add_base(line)) if tax_key_add_base not in done_taxes: + if line.currency_id != self.company_id.currency_id: + amount = self.company_id.currency_id._convert(line.tax_base_amount, line.currency_id, self.company_id, line.date) + else: + amount = line.tax_base_amount + res[line.tax_line_id.tax_group_id]['base'] += amount # The base should be added ONCE - res[line.tax_line_id.tax_group_id]['base'] += line.tax_base_amount done_taxes.add(tax_key_add_base) res = sorted(res.items(), key=lambda l: l[0].sequence) move.amount_by_group = [(