From a691a489b1f3789e2791ed335122f3bfa8b167dd Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 30 Jun 2008 16:08:08 +0000 Subject: [PATCH] Improvement in translation system bzr revid: fp@tinyerp.com-fb31e8fd7e9c2a8f43d94ff24377a3175fcefe2f --- bin/osv/orm.py | 2 +- bin/report/report_sxw.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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):