[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
This commit is contained in:
Olivier Dony
2010-04-23 19:08:58 +02:00
parent 5975104b4f
commit 7ce4e8e479
+3 -1
View File
@@ -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