[FIX] res.currency: correctly compute the number of decimal places for currencies formatting in 'get_format_currencies_js_function'.

This commit is contained in:
Arthur Maniet 2014-12-04 10:51:54 +01:00
parent 04f3fffdb4
commit 35431de125
1 changed files with 1 additions and 1 deletions

View File

@ -276,7 +276,7 @@ class res_currency(osv.osv):
That function expects the number as first parameter and the currency id as second parameter. In case of failure it returns undefined."""
function = ""
for row in self.search_read(cr, uid, domain=[], fields=['id', 'name', 'symbol', 'rounding', 'position'], context=context):
digits = int(math.log10(1 / row['rounding']))
digits = int(math.ceil(math.log10(1 / row['rounding'])))
symbol = row['symbol'] or row['name']
format_number_str = "openerp.web.format_value(arguments[0], {type: 'float', digits: [69," + str(digits) + "]}, 0.00)"