From 8016ae059ef780fadf1f4128849655f25bd83dac Mon Sep 17 00:00:00 2001 From: Louis Baudoux Date: Thu, 30 Mar 2023 14:47:16 +0000 Subject: [PATCH] [FIX] account: fix tax rounding adjustments in `_check_total_amount` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tax adjustment could fail in the case where the user used another language than English. The `Untaxed Total` key was translated when inserted in the `tax_totals['groups_by_subtotal']` dictionary but not when it was accessed. Ticket #3207452 closes odoo/odoo#117284 X-original-commit: 02b5037ff09ed193dca0899cacae48eaa34f9ea4 Signed-off-by: William André (wan) --- addons/account/models/account_move.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 86081a1b3a4..23051ea5f31 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -2709,8 +2709,8 @@ class AccountMove(models.Model): totals = self.tax_totals tax_amount_rounding_error = amount_total - totals['amount_total'] if not float_is_zero(tax_amount_rounding_error, precision_rounding=self.currency_id.rounding): - if 'Untaxed Amount' in totals['groups_by_subtotal']: - totals['groups_by_subtotal']['Untaxed Amount'][0]['tax_group_amount'] += tax_amount_rounding_error + if _('Untaxed Amount') in totals['groups_by_subtotal']: + totals['groups_by_subtotal'][_('Untaxed Amount')][0]['tax_group_amount'] += tax_amount_rounding_error totals['amount_total'] = amount_total self.tax_totals = totals