diff options
| author | Raphael Collet <rco@odoo.com> | 2020-09-16 12:29:02 +0000 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2020-09-17 14:07:26 +0000 |
| commit | 77ec3b224f3fd6c8ad6dccbbf7612be8464a385d (patch) | |
| tree | b9492603bd11ef228e96d09d774c66a200c2a1cf /odoo/osv/expression.py | |
| parent | 9512a23f48176fe0e7970039c824281c4af18162 (diff) | |
[FIX] core: flush() domain returned by search method
Assume field B depends on A, and searching on B is rewritten as a domain
that mentions A. If A is modified, and then we search on B, one has to
flush A to the database before searching.
closes odoo/odoo#57958
X-original-commit: b242b7b1382ee39ebefa58c556931b7dae77f669
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'odoo/osv/expression.py')
| -rw-r--r-- | odoo/osv/expression.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/odoo/osv/expression.py b/odoo/osv/expression.py index aba79c3859d..6aa0c88ab5c 100644 --- a/odoo/osv/expression.py +++ b/odoo/osv/expression.py @@ -707,6 +707,7 @@ class expression(object): right = comodel._search([(path[1], operator, right)], order='id') operator = 'in' domain = field.determine_domain(model, operator, right) + model._flush_search(domain, order='id') for elem in normalize_domain(domain): push(elem, model, alias, internal=True) |
