[REVERT] previous commit cause failure in runbot
authorJean-Christophe VASSORT <jcv@openerp.com>
Wed, 7 Mar 2012 14:10:09 +0000 (15:10 +0100)
committerJean-Christophe VASSORT <jcv@openerp.com>
Wed, 7 Mar 2012 14:10:09 +0000 (15:10 +0100)
bzr revid: jcv@openerp.com-20120307141009-csv57tc06lu78f6i

bin/osv/orm.py

index b643802..5c5ce1c 100644 (file)
@@ -1960,30 +1960,13 @@ class orm_memory(orm_template):
                 result.append(r)
                 if id in self.datas:
                     self.datas[id]['internal.date_access'] = time.time()
-                    
-            # all non inherited fields for which the attribute whose name is in load is False
             fields_post = filter(lambda x: x in self._columns and not getattr(self._columns[x], load), fields_to_read)
-            todo = {}
             for f in fields_post:
-                todo.setdefault(self._columns[f]._multi, [])
-                todo[self._columns[f]._multi].append(f)
-            for key, val in todo.items():
-                if key:
-                    res2 = self._columns[val[0]].get_memory(cr, self, ids, val, user, context=context, values=result)
-                    for pos in val:
-                        for record in result:
-                            if isinstance(res2[record['id']], str): res2[record['id']] = eval(res2[record['id']]) #TOCHECK : why got string instend of dict in python2.6
-                            multi_fields = res2.get(record['id'],{})
-                            if multi_fields:
-                                record[pos] = multi_fields.get(pos,[])
-                else:
-                    for f in val:
-                        res2 = self._columns[f].get_memory(cr, self, ids, f, user, context=context, values=result)
-                        for record in result:
-                            if res2:
-                                record[f] = res2[record['id']]
-                            else:
-                                record[f] = []
+                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_orig, (int, long)):
+                return result[0]
         return result
 
     def write(self, cr, user, ids, vals, context=None):