[FIX] Fixed the read() method in orm_memory
authorAnup (OpenERP) <ach@tinyerp.com>
Wed, 8 Dec 2010 12:41:27 +0000 (18:11 +0530)
committerAnup (OpenERP) <ach@tinyerp.com>
Wed, 8 Dec 2010 12:41:27 +0000 (18:11 +0530)
lp bug: https://launchpad.net/bugs/366089 fixed

bzr revid: ach@tinyerp.com-20101208124127-z3q9ctf91vur0f5m

bin/osv/orm.py

index 346aaa7..8398213 100644 (file)
@@ -1514,6 +1514,7 @@ class orm_memory(orm_template):
             fields_to_read = self._columns.keys()
         result = []
         if self.datas:
+            ids_orig = ids
             if isinstance(ids, (int, long)):
                 ids = [ids]
             for id in ids:
@@ -1531,7 +1532,7 @@ class orm_memory(orm_template):
                 res2 = self._columns[f].get_memory(cr, self, ids, f, user, context=context, values=result)
                 for record in result:
                     record[f] = res2[record['id']]
-            if isinstance(ids, (int, long)):
+            if isinstance(ids_orig, (int, long)):
                 return result[0]
         return result