[FIX] fix problem of search multiple conditions O2M with active=False then not work.

lp bug: https://launchpad.net/bugs/711919 fixed

bzr revid: ysa@tinyerp.com-20110603095526-s26wgkahwc1d6zfd
This commit is contained in:
Yogesh (OpenERP) 2011-06-03 15:25:26 +05:30
parent ce5d00e03b
commit 9cb3205a64
1 changed files with 12 additions and 5 deletions

View File

@ -108,6 +108,10 @@ class expression(object):
self.__main_table = table
self.__all_tables.add(table)
active = False
for exp in self.__exp:
if exp[0] == 'active':
active = exp
i = -1
while i + 1<len(self.__exp):
i += 1
@ -150,7 +154,10 @@ class expression(object):
# Making search easier when there is a left operand as field.o2m or field.m2m
if field._type in ['many2many','one2many']:
right = field_obj.search(cr, uid, [(fargs[1], operator, right)], context=context)
right1 = table.search(cr, uid, [(fargs[0],'in', right)], context=context)
if active:
right1 = table.search(cr, uid, [(fargs[0],'in', right),active], context=context)
else:
right1 = table.search(cr, uid, [(fargs[0],'in', right)], context=context)
if right1 == []:
self.__exp[i] = ( 'id', '=', 0 )
else: