diff options
| author | Michael Brown <mbrown@fensystems.co.uk> | 2016-08-08 21:06:01 +0100 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2016-10-06 17:51:28 +0200 |
| commit | 22c4a0c1b06fef3d27fc6a0cd2c7d00ccc2816de (patch) | |
| tree | cdc13668ae681d826d852ab0a77a72401e881280 | |
| parent | 1b3d60d961bd9b79d877ba8e69c2b9495d5aa442 (diff) | |
[FIX] expression: pass context to hierarchical domain operators
The expression context is currently passed to to_ids() but is missing
from all calls to child_of_domain() or parent_of_domain(). These
methods are effectively always passed a context of None.
Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
Closes #13688 (part 1/2)
| -rw-r--r-- | openerp/osv/expression.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/openerp/osv/expression.py b/openerp/osv/expression.py index 13413f2fbf5..8b55fe3f646 100644 --- a/openerp/osv/expression.py +++ b/openerp/osv/expression.py @@ -828,7 +828,7 @@ class expression(object): elif left == 'id' and operator in HIERARCHY_FUNCS: ids2 = to_ids(right, model, context) - dom = HIERARCHY_FUNCS[operator](left, ids2, model) + dom = HIERARCHY_FUNCS[operator](left, ids2, model, context=context) for dom_leaf in reversed(dom): new_leaf = create_substitution_leaf(leaf, dom_leaf, model) push(new_leaf) @@ -949,9 +949,9 @@ class expression(object): elif column._type == 'one2many' and operator in HIERARCHY_FUNCS: ids2 = to_ids(right, comodel, context) if column._obj != model._name: - dom = HIERARCHY_FUNCS[operator](left, ids2, comodel, prefix=column._obj) + dom = HIERARCHY_FUNCS[operator](left, ids2, comodel, prefix=column._obj, context=context) else: - dom = HIERARCHY_FUNCS[operator]('id', ids2, model, parent=left) + dom = HIERARCHY_FUNCS[operator]('id', ids2, model, parent=left, context=context) for dom_leaf in reversed(dom): push(create_substitution_leaf(leaf, dom_leaf, model)) @@ -1007,7 +1007,7 @@ class expression(object): return select_from_where(cr, rel_id1, rel_table, rel_id2, ids, operator) ids2 = to_ids(right, comodel, context) - dom = HIERARCHY_FUNCS[operator]('id', ids2, comodel) + dom = HIERARCHY_FUNCS[operator]('id', ids2, comodel, context=context) ids2 = comodel.search(cr, uid, dom, context=context) push(create_substitution_leaf(leaf, ('id', 'in', _rec_convert(ids2)), model)) else: @@ -1046,9 +1046,9 @@ class expression(object): if operator in HIERARCHY_FUNCS: ids2 = to_ids(right, comodel, context) if column._obj != model._name: - dom = HIERARCHY_FUNCS[operator](left, ids2, comodel, prefix=column._obj) + dom = HIERARCHY_FUNCS[operator](left, ids2, comodel, prefix=column._obj, context=context) else: - dom = HIERARCHY_FUNCS[operator]('id', ids2, model, parent=left) + dom = HIERARCHY_FUNCS[operator]('id', ids2, model, parent=left, context=context) for dom_leaf in reversed(dom): push(create_substitution_leaf(leaf, dom_leaf, model)) else: |
