[IMP] orm: added an assert on the return value of function fields.

bzr revid: vmt@openerp.com-20110524101810-fdrj5hqxrc9c6856
This commit is contained in:
Vo Minh Thu
2011-05-24 12:18:10 +02:00
parent 886ec09070
commit 3286ef93b8
+3
View File
@@ -3053,6 +3053,9 @@ class orm(orm_template):
for key, val in todo.items():
if key:
res2 = self._columns[val[0]].get(cr, self, ids, val, user, context=context, values=res)
assert res2 is not None, \
'The function field "%s" on the "%s" model returned None\n' \
'(a dictionary was expected).' % (val[0], self._name)
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