summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorced <>2007-07-30 13:35:11 +0000
committerced <>2007-07-30 13:35:11 +0000
commite85779bb19aaedf8a73ae7ab40babc30a17dfcae (patch)
treeadf7520ae5f5bb3ea0903ad12c48c8f8518512a2
parent4208baf595ffd504099522727a150586843167bc (diff)
account, base: fix rounding for reconcile
Add new method on res.currency to check if a amount of currency must be considered as zero in regards of the definition of the currency. bzr revid: ced-665e6d02847be8e8713a86b383912d4d4eddf9dc
-rw-r--r--bin/addons/base/res/res_currency.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/addons/base/res/res_currency.py b/bin/addons/base/res/res_currency.py
index 485ba469d28..7f7cf1475c8 100644
--- a/bin/addons/base/res/res_currency.py
+++ b/bin/addons/base/res/res_currency.py
@@ -71,6 +71,9 @@ class res_currency(osv.osv):
def round(self, cr, uid, currency, amount):
return round(amount / currency.rounding) * currency.rounding
+ def is_zero(self, cr, uid, currency, amount):
+ return self.round(cr, uid, currency, amount) < currency.rounding
+
def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount, round=True, context={}):
if not from_currency_id:
from_currency_id = to_currency_id