diff --git a/addons/account_voucher/models/account_voucher.py b/addons/account_voucher/models/account_voucher.py index e9eca30907a..92a291af5b1 100644 --- a/addons/account_voucher/models/account_voucher.py +++ b/addons/account_voucher/models/account_voucher.py @@ -341,11 +341,16 @@ class AccountVoucher(models.Model): # When global rounding is activated, we must wait until all tax lines are computed to # merge them. if tax_calculation_rounding_method == 'round_globally': - self.env['account.move.line'].create(move_line) + # _apply_taxes modifies the dict move_line in place to account for included/excluded taxes tax_lines_vals += self.env['account.move.line'].with_context(round=False)._apply_taxes( move_line, move_line.get('debit', 0.0) - move_line.get('credit', 0.0) ) + # rounding False means the move_line's amount are not rounded + currency = self.env['res.currency'].browse(company_currency) + move_line['debit'] = currency.round(move_line['debit']) + move_line['credit'] = currency.round(move_line['credit']) + self.env['account.move.line'].create(move_line) else: self.env['account.move.line'].with_context(apply_taxes=True).create(move_line)