From aa5543f5f1be14cb494759ebc5af71de4050b863 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Wed, 16 Mar 2016 13:24:27 +0100 Subject: [PATCH] Always round tax base per line issue5370 review23921002 --- tax.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tax.py b/tax.py index fc49d63433..c74dfacfac 100644 --- a/tax.py +++ b/tax.py @@ -1036,8 +1036,7 @@ class TaxableMixin(object): if not self.currency: return for taxline in taxes.itervalues(): - for attribute in ('base', 'amount'): - taxline[attribute] = self.currency.round(taxline[attribute]) + taxline['amount'] = self.currency.round(taxline['amount']) def _get_taxes(self): pool = Pool() @@ -1054,6 +1053,8 @@ class TaxableMixin(object): line.quantity, self.tax_date) for tax in l_taxes: taxline = self._compute_tax_line(self.tax_type, **tax) + if self.currency: + taxline['base'] = self.currency.round(taxline['base']) if taxline not in taxes: taxes[taxline] = taxline else: