From 68dc2f322a8300cc12bb7215bb0e557f20b8980c Mon Sep 17 00:00:00 2001 From: "Jay (OpenERP)" Date: Fri, 3 Sep 2010 18:39:45 +0530 Subject: [PATCH] [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 --- bin/osv/orm.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 0ddb6db0655..6f73f821f8e 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -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