[FIX] account_edi: tax round globally

Prevent "per line" rounding taxes when tax rounding method is round globally.

Manual fwd port of https://github.com/odoo/odoo/commit/46504495664be211cf2ddbf2fa7532c022b1e5f0

closes odoo/odoo#105662

Task: opw-2963947
X-original-commit: c2b8ab136a5df4d70274d4abc5ceb14fa88b4149
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
This commit is contained in:
jbw-odoo
2022-11-14 15:21:26 +01:00
parent 4bf848e25c
commit 82249b1c04
+4 -1
View File
@@ -862,6 +862,9 @@ class AccountTax(models.Model):
tax_values_list = []
for tax_res in taxes_res['taxes']:
tax_amount = tax_res['amount'] / rate
if self.company_id.tax_calculation_rounding_method == 'round_per_line':
tax_amount = currency.round(tax_amount)
tax_rep = self.env['account.tax.repartition.line'].browse(tax_res['tax_repartition_line_id'])
tax_values_list.append({
**tax_res,
@@ -869,7 +872,7 @@ class AccountTax(models.Model):
'base_amount_currency': tax_res['base'],
'base_amount': currency.round(tax_res['base'] / rate),
'tax_amount_currency': tax_res['amount'],
'tax_amount': currency.round(tax_res['amount'] / rate),
'tax_amount': tax_amount,
})
else: