Fix Many2One for None id and remove print statement
This commit is contained in:
1 parent
03bfac7984
commit
4978a4d609
2 files changed
+2
-4
No files matched your search
@@ -246,7 +246,8 @@ class Many2One(_column):
|
||||
res.setdefault(i, '')
|
||||
obj = obj.pool.get(self._obj)
|
||||
obj_names = {}
|
||||
for obj_id, name in obj.name_get(cursor, user, res.values(),
|
||||
for obj_id, name in obj.name_get(cursor, user,
|
||||
[ x for x in res.values() if x],
|
||||
context=context):
|
||||
obj_names[obj_id] = name
|
||||
|
||||
@@ -255,7 +256,6 @@ class Many2One(_column):
|
||||
res[i] = (res[i], obj_names[res[i]])
|
||||
else:
|
||||
res[i] = False
|
||||
print "many2one:", res
|
||||
return res
|
||||
|
||||
def set(self, cursor, obj_src, obj_id, field, values, user=None,
|
||||
|
||||
@@ -960,7 +960,6 @@ class ORM(object):
|
||||
i[key] = False
|
||||
if isinstance(ids, (int, long)):
|
||||
return result[0]
|
||||
print result
|
||||
return result
|
||||
|
||||
def _read_flat(self, cursor, user, ids, fields_names, context=None,
|
||||
@@ -1004,7 +1003,6 @@ class ORM(object):
|
||||
' ORDER BY ' + self._order)
|
||||
|
||||
res = cursor.dictfetchall()
|
||||
print "res:", res
|
||||
else:
|
||||
res = [{'id':x} for x in ids]
|
||||
|
||||
|
||||
Reference in new issue
Block a user