From c3151daea7256a8b967f8ebc747602c86bd0d804 Mon Sep 17 00:00:00 2001 From: Swapnesh Shah Date: Fri, 31 Jan 2020 16:48:05 +0000 Subject: [PATCH] [FIX] account: Use current date as fallback to convert currency Fixes #43705 Before this commit, There will be tracback on converting currecy if there is not date on tax line. Now we use current date to as fallback to convert currency. closes odoo/odoo#44559 X-original-commit: 2b88d71c6e4815334f0edaa24d6041c5facd811e Signed-off-by: Laurent Smet --- addons/account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index d919d2c95d8..e4866d516a0 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1312,7 +1312,7 @@ class AccountMove(models.Model): 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) + amount = self.company_id.currency_id._convert(line.tax_base_amount, line.currency_id, self.company_id, line.date or fields.Date.today()) else: amount = line.tax_base_amount res[line.tax_line_id.tax_group_id]['base'] += amount