[FIX] expression: we dont add any restriction on the main ids
authorVo Minh Thu <vmt@openerp.com>
Wed, 5 Oct 2011 13:33:37 +0000 (15:33 +0200)
committerVo Minh Thu <vmt@openerp.com>
Wed, 5 Oct 2011 13:33:37 +0000 (15:33 +0200)
as the possible active=True/False is already present in the main domain.

bzr revid: vmt@openerp.com-20111005133337-p8nvv26tlii7x253

openerp/addons/base/test/test_osv_expression.yml
openerp/osv/expression.py

index d7e3429..f67a99c 100644 (file)
         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 }: |
index 25cdffd..cf7ef3b 100644 (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):