Round on currency

bzr revid: pinky-c8bda169634ffd0f078deaba5d6def90e167df74
This commit is contained in:
pinky 2006-12-27 16:20:27 +00:00
parent 722658e96d
commit 4335486ae8
1 changed files with 3 additions and 2 deletions

View File

@ -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):