[FIX] _read_flat() method corrected for multi
authorAnup (OpenERP) <ach@tinyerp.com>
Fri, 15 Oct 2010 13:46:30 +0000 (19:16 +0530)
committerAnup (OpenERP) <ach@tinyerp.com>
Fri, 15 Oct 2010 13:46:30 +0000 (19:16 +0530)
lp bug: https://launchpad.net/bugs/625898 fixed

bzr revid: ach@tinyerp.com-20101015134630-law0exawyhlyec30

bin/osv/orm.py

index 3dc973d..91bd912 100644 (file)
@@ -3107,7 +3107,9 @@ class orm(orm_template):
                 for pos in val:
                     for record in res:
                         if isinstance(res2[record['id']], str): res2[record['id']] = eval(res2[record['id']]) #TOCHECK : why got string instend of dict in python2.6
-                        record[pos] = res2[record['id']][pos]
+                        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(cr, self, ids, f, user, context=context, values=res)