From 5550bcb5228425ec658adf01e4be01a5669c8caa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 25 Jul 2008 16:37:27 +0200 Subject: [PATCH] Remove rounding on each lines for tax computation --- purchase.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/purchase.py b/purchase.py index e9ad0f14d8..1ffea9b8c7 100644 --- a/purchase.py +++ b/purchase.py @@ -189,12 +189,11 @@ class Purchase(OSV): purchase, context=context)) res.setdefault(purchase.id, Decimal('0.0')) for line in purchase.lines: + # Don't round on each line to handle rounding error for tax in tax_obj.compute( cursor, user, [t.id for t in line.taxes], line.unit_price, line.quantity, context=ctx): res[purchase.id] += tax['amount'] - res[purchase.id] = currency_obj.round(cursor, user, purchase.currency, - res[purchase.id]) res[purchase.id] = currency_obj.round(cursor, user, purchase.currency, res[purchase.id]) return res