fix DivideByZero
bzr revid: stephane@tinyerp.com-20080922101605-lsof52sp7b6gi60f
This commit is contained in:
parent
939fd61f1a
commit
9cdba9adce
|
@ -71,7 +71,10 @@ class res_currency(osv.osv):
|
|||
_order = "code"
|
||||
|
||||
def round(self, cr, uid, currency, amount):
|
||||
return round(amount / currency.rounding) * currency.rounding
|
||||
if currency.rounding == 0:
|
||||
return 0.0
|
||||
else:
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue