From 4335486ae8580e67d2329ba4d44305b0fda4850f Mon Sep 17 00:00:00 2001 From: pinky <> Date: Wed, 27 Dec 2006 16:20:27 +0000 Subject: [PATCH] Round on currency bzr revid: pinky-c8bda169634ffd0f078deaba5d6def90e167df74 --- bin/addons/base/res/res_currency.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/addons/base/res/res_currency.py b/bin/addons/base/res/res_currency.py index a4fc0b07eba..e70342596d1 100644 --- a/bin/addons/base/res/res_currency.py +++ b/bin/addons/base/res/res_currency.py @@ -64,6 +64,9 @@ class res_currency(osv.osv): } _order = "code" + def round(self, cr, uid, currency, amount): + return round(amount, currency.rouding) + def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount): if to_currency_id==from_currency_id: return from_amount @@ -72,8 +75,6 @@ class res_currency(osv.osv): if from_currency['rate'] == 0 or to_currency['rate'] == 0: raise osv.except_osv('Error', 'No rate found for the currency') return currency(from_amount * from_currency['rate']/to_currency['rate'], to_currency['accuracy'], to_currency['rounding']) - - res_currency() class res_currency_rate(osv.osv):