From 47bbb504a89c4133cf16d3f9aff28e2c5823c771 Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Thu, 27 Jun 2019 11:20:00 +0000 Subject: [PATCH] [FIX] account_voucher: round globally 1. Set "Round Globally" on Invoicing settings; 2. Create a new vendors receipts and validate it; There are an error messages that said : "Cannot create unbalanced journal entry." Fine turning of : 3e147220fd3b410ad8b530daccff5f697e1749c6 opw-2026534 closes #32667 closes odoo/odoo#34415 Signed-off-by: Jorge Pinna Puissant (jpp) --- addons/account_voucher/models/account_voucher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_voucher/models/account_voucher.py b/addons/account_voucher/models/account_voucher.py index 2220208f8d2..05826057c17 100644 --- a/addons/account_voucher/models/account_voucher.py +++ b/addons/account_voucher/models/account_voucher.py @@ -304,7 +304,7 @@ class AccountVoucher(models.Model): 'payment_id': self._context.get('payment_id'), } # Create one line per tax and fix debit-credit for the move line if there are tax included - if (line.tax_ids): + if (line.tax_ids and tax_calculation_rounding_method == 'round_per_line'): tax_group = line.tax_ids.compute_all(self._convert(line.price_unit), self.company_id.currency_id, line.quantity, line.product_id, self.partner_id) if move_line['debit']: move_line['debit'] = tax_group['total_excluded'] if move_line['credit']: move_line['credit'] = tax_group['total_excluded']