[FIX] account: fix tax rounding adjustments in _check_total_amount

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) <wan@odoo.com>
This commit is contained in:
Louis Baudoux
2023-03-31 00:27:41 +02:00
parent f697decd51
commit 8016ae059e
+2 -2
View File
@@ -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