← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 625898] Re: exception in orm.py if res2[record['id']] is False

 

** Branch linked: lp:openobject-server

-- 
exception in orm.py if res2[record['id']] is False
https://bugs.launchpad.net/bugs/625898
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP OpenObject.

Status in OpenObject Server: New

Bug description:
I fixed this some time ago and no longer have the traceback.

The following change fixes the problem:


=== modified file 'bin/osv/orm.py'
--- bin/osv/orm.py      2010-08-12 20:08:48 +0000
+++ bin/osv/orm.py      2010-08-26 04:28:07 +0000
@@ -2947,7 +2947,10 @@
                 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]
+                        if res2[record['id']]:
+                            record[pos] = res2[record['id']][pos]
+                        else:
+                            record[pos] = []
             else:
                 for f in val:
                     res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)

Applies to revision 2572, trunk