[FIX] read() should never return [] if fields are not empty

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

bzr revid: jvo@tinyerp.com-20100903130945-b03ggz7hg8egymv0
This commit is contained in:
Jay (OpenERP) 2010-09-03 18:39:45 +05:30
parent f74688a015
commit 68dc2f322a
1 changed files with 15 additions and 0 deletions

View File

@ -3040,6 +3040,21 @@ class orm(orm_template):
else:
res = map(lambda x: {'id': x}, ids)
if not res:
res = map(lambda x: {'id': x}, ids)
for record in res:
for f in fields_to_read:
field_val = False
if f in self._columns.keys():
ftype = self._columns[f]._type
elif key in self._inherit_fields.keys():
ftype = self._inherit_fields[f][2]._type
else:
continue
if ftype in ('one2many', 'many2many'):
field_val = []
record.update({f:field_val})
for f in fields_pre:
if f == self.CONCURRENCY_CHECK_FIELD:
continue