[FIX] expression: allow creating child_of expression even if "id" field has been...
authorChristophe Simonis <chs@openerp.com>
Tue, 23 Apr 2013 18:19:26 +0000 (20:19 +0200)
committerChristophe Simonis <chs@openerp.com>
Tue, 23 Apr 2013 18:19:26 +0000 (20:19 +0200)
lp bug: https://launchpad.net/bugs/1030942 fixed
lp bug: https://launchpad.net/bugs/1131992 fixed

bzr revid: chs@openerp.com-20130423181926-yk628txd6yiybtko

openerp/osv/expression.py

index ba00c2c..8d0e937 100644 (file)
@@ -791,7 +791,7 @@ class expression(object):
                 leaf.add_join_context(next_model, working_model._inherits[next_model._name], 'id', working_model._inherits[next_model._name])
                 push(leaf)
 
-            elif not field and left == 'id' and operator == 'child_of':
+            elif left == 'id' and operator == 'child_of':
                 ids2 = to_ids(right, working_model, context)
                 dom = child_of_domain(left, ids2, working_model)
                 for dom_leaf in reversed(dom):