[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:
parent
004cb7d89c
commit
b3c00f5e4f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue