Skip to content

Commit

Permalink
[FIX] account_edi: tax round globally
Browse files Browse the repository at this point in the history
Prevent "per line" rounding taxes when tax rounding method is round globally.

Manual fwd port of odoo@4650449

closes odoo#105460

Task: opw-2963947
X-original-commit: 82c431d
Signed-off-by: Laurent Smet <[email protected]>
  • Loading branch information
jbw-odoo committed Nov 14, 2022
1 parent a239802 commit c2b8ab1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion addons/account/models/account_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,14 +862,17 @@ def _compute_taxes_for_single_line(self, base_line, handle_price_include=True, i

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,
'tax_repartition_line': tax_rep,
'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:
Expand Down

0 comments on commit c2b8ab1

Please sign in to comment.