Add search on one2many for list of ids

bzr revid: ced-a47b17426edd6b63655cd56cb9eb0ea1c695cf46
This commit is contained in:
ced
2007-12-06 12:13:58 +00:00
parent 6f87888b5b
commit 4d3891892c
+5 -2
View File
@@ -1635,8 +1635,11 @@ class orm(object):
elif field._type=='one2many':
field_obj = self.pool.get(field._obj)
# get the ids of the records of the "distant" resource
ids2 = [x[0] for x in field_obj.name_search(cr, user, args[i][2], [], args[i][1])]
if isinstance(args[i][2], basestring):
# get the ids of the records of the "distant" resource
ids2 = [x[0] for x in field_obj.name_search(cr, user, args[i][2], [], args[i][1])]
else:
ids2 = args[i][2]
if not ids2:
args[i] = ('id','=','0')
else: