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