~openerp-community/openobject-server/taktik-5.0.7

« back to all changes in this revision

Viewing changes to bin/addons/base/res/res_currency.py

  • Committer: Jay(Open ERP)
  • Date: 2009-09-18 13:55:56 UTC
  • Revision ID: jvo@tinyerp.com-20090918135556-lmun5j8d27437xkc
[FIX] Price Accuracy : rounding made to be based on --price_accuracy option

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
from tools.misc import currency
28
28
from tools.translate import _
 
29
from tools import config
29
30
 
30
31
import mx.DateTime
31
32
from mx.DateTime import RelativeDateTime, now, DateTime, localtime
67
68
        if currency.rounding == 0:
68
69
            return 0.0
69
70
        else:
70
 
            return round(amount / currency.rounding) * currency.rounding
 
71
            return round(amount / currency.rounding, int(config['price_accuracy'])) * currency.rounding
71
72
 
72
73
    def is_zero(self, cr, uid, currency, amount):
73
74
        return abs(self.round(cr, uid, currency, amount)) < currency.rounding