[FIX] expression: we dont add any restriction on the main ids

as the possible active=True/False is already present in the main domain.

bzr revid: vmt@openerp.com-20111005133337-p8nvv26tlii7x253
This commit is contained in:
Vo Minh Thu 2011-10-05 15:33:37 +02:00
parent 07121a762b
commit 25a883b2aa
2 changed files with 2 additions and 9 deletions

View File

@ -500,7 +500,7 @@
except psycopg2.DataError:
# Should give: 'DataError: invalid input syntax for type timestamp' or similar
cr.execute('ROLLBACK TO SAVEPOINT expression_failure_test')
-
Testing for Many2Many field with category supplier and active=False
-
!python {model: res.partner }: |

View File

@ -405,10 +405,6 @@ class expression(object):
return [value]
return list(value)
active = False
for exp in self.__exp:
if exp[0] == 'active':
active = exp
i = -1
while i + 1<len(self.__exp):
i += 1
@ -466,10 +462,7 @@ 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, [(field_path[1], operator, right)], context=context)
domain = [(fargs[0],'in', right)]
if active:
domain.append(active)
right1 = table.search(cr, uid, domain, context=context)
right1 = table.search(cr, uid, [(field_path[0],'in', right)], context=dict(context, active_test=False))
self.__exp[i] = ('id', 'in', right1)
if not isinstance(field, fields.property):