summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Pinna Puissant <jpp@odoo.com>2019-06-27 11:20:00 +0000
committerJorge Pinna Puissant <jpp@odoo.com>2019-06-27 11:35:03 +0000
commit47bbb504a89c4133cf16d3f9aff28e2c5823c771 (patch)
treea98b5ea828153f5e1951498683511f896f01b0f2
parent7f57d3c5f21ff1fc88a07a5f68f7d2a2b6f7005e (diff)
[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) <jpp@odoo.com>
-rw-r--r--addons/account_voucher/models/account_voucher.py2
1 files changed, 1 insertions, 1 deletions
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']