From 7ce4e8e479fed419559e5ac986776dc982744676 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Fri, 23 Apr 2010 19:08:58 +0200 Subject: [PATCH] [FIX] port of fix for launchpad bug 452854 on rounding for invoices in foreign currencies lp bug: https://launchpad.net/bugs/452854 fixed bzr revid: odo@openerp.com-20100423170858-0y7n7v89rzt1jpi1 --- bin/addons/base/res/res_currency.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/addons/base/res/res_currency.py b/bin/addons/base/res/res_currency.py index 4a304108527..0e4faa68143 100644 --- a/bin/addons/base/res/res_currency.py +++ b/bin/addons/base/res/res_currency.py @@ -79,7 +79,9 @@ class res_currency(osv.osv): if currency.rounding == 0: return 0.0 else: - return round(amount / currency.rounding,6) * currency.rounding + # /!\ First member below must be rounded to full unit! + # Do not pass a rounding digits value to round() + return round(amount / currency.rounding) * currency.rounding def is_zero(self, cr, uid, currency, amount): return abs(self.round(cr, uid, currency, amount)) < currency.rounding