Improvement in translation system
bzr revid: fp@tinyerp.com-fb31e8fd7e9c2a8f43d94ff24377a3175fcefe2f
This commit is contained in:
parent
b70a2eb8a2
commit
a691a489b1
|
@ -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:
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue