report_sxw: formating classes should return strings.

bzr revid: vmt@openerp.com-20110920132323-m9tjo3akasqlr0eg
This commit is contained in:
Vo Minh Thu 2011-09-20 15:23:23 +02:00
commit 2bd4708023
1 changed files with 4 additions and 4 deletions

View File

@ -81,7 +81,7 @@ class _format(object):
class _float_format(float, _format):
def __init__(self,value):
super(_float_format, self).__init__()
self.val = value
self.val = value or 0.0
def __str__(self):
digits = 2
@ -89,17 +89,17 @@ class _float_format(float, _format):
digits = self._field.digits[1]
if hasattr(self, 'lang_obj'):
return self.lang_obj.format('%.' + str(digits) + 'f', self.name, True)
return self.val
return str(self.val)
class _int_format(int, _format):
def __init__(self,value):
super(_int_format, self).__init__()
self.val = value and str(value) or str(0)
self.val = value or 0
def __str__(self):
if hasattr(self,'lang_obj'):
return self.lang_obj.format('%.d', self.name, True)
return self.val
return str(self.val)
class _date_format(str, _format):
def __init__(self,value):