[FIX] Export will consider float values as float and char as char

lp bug: https://launchpad.net/bugs/357945 fixed

bzr revid: jvo@tinyerp.com-20090703060823-5aupesiimak1bb7x
This commit is contained in:
ACH,JVO 2009-07-03 11:38:23 +05:30 committed by Jay (Open ERP)
parent 004cb7d89c
commit b3c00f5e4f
1 changed files with 16 additions and 0 deletions

View File

@ -433,6 +433,16 @@ class orm_template(object):
return browse_null()
def __export_row(self, cr, uid, row, fields, context=None):
def check_type(type,r):
if type == 'float':
return 0.0
elif type == 'integer':
return 0
elif type == 'char':
return ''
return r
lines = []
data = map(lambda x: '', range(len(fields)))
done = []
@ -444,6 +454,12 @@ class orm_template(object):
while i < len(f):
r = r[f[i]]
if not r:
if f[i] in self._columns:
r = check_type(self._columns[f[i]]._type,r)
elif f[i] in self._inherit_fields:
r = check_type(self._inherit_fields[f[i]][2]._type,r)
data[fpos] = r
break
if isinstance(r, (browse_record_list, list)):
first = True