exception in orm.py if res2[record['id']] is False

Bug #625898 reported by Jim Norman
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

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

Tags: trunk

Related branches

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Thanks Jim,
It has been fixed by revision <email address hidden>.

Changed in openobject-server:
milestone: none → 6.0
status: New → Fix Released
Revision history for this message
rihab (rihab2312) wrote :

I am new to python and OpenERP and I apologise if my question is inconvenient. But I am trying to add a control that check if a field is empty, but I am getting this error:

if isinstance(res2[record['id']], str): res2[record['id']] = eval(res2[record['id']]) #TOCHECK : why got string instend of dict in python2.6
KeyError: 56

Please could you help me? What the problem could be? Thanks in advance

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.