diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 6701c6ef7c5..e7c0988c276 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -167,7 +167,7 @@ class browse_record(object): for n,f in ffields: if f._type in self._fields_process: for d in datas: - d[n] = self._fields_process[f._type](d[n], self) + d[n] = self._fields_process[f._type](d[n], self, f) # create browse records for 'remote' objects for data in datas: diff --git a/bin/report/report_sxw.py b/bin/report/report_sxw.py index ff85ea74ee9..181cefdf580 100644 --- a/bin/report/report_sxw.py +++ b/bin/report/report_sxw.py @@ -146,9 +146,10 @@ _LOCALE2WIN32 = { } class _format(object): - def __init__(self, name, object): + def __init__(self, name, object, field): #super(_date_format, self).__init__(self) self.object = object + self._field = field self.name=name lc, encoding = locale.getdefaultlocale() if not encoding: @@ -174,7 +175,10 @@ class _float_format(_format): def __str__(self): if not self.object._context: return self.name - return locale.format('%.' + str(2) + 'f', self.name, True) + digit = 2 + if hasattr(self._field, 'digits') and self._field.digits: + digit = self._field.digits[1] + return locale.format('%.' + str(digit) + 'f', self.name, True) class _int_format(_format): def __str__(self):