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/addons/test_new_api/models/test_new_api.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/addons/test_new_api/models/test_new_api.py')
| -rw-r--r-- | odoo/addons/test_new_api/models/test_new_api.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/odoo/addons/test_new_api/models/test_new_api.py b/odoo/addons/test_new_api/models/test_new_api.py index 4ca9417ae5a..c0f7615f9d3 100644 --- a/odoo/addons/test_new_api/models/test_new_api.py +++ b/odoo/addons/test_new_api/models/test_new_api.py @@ -170,6 +170,7 @@ class Message(models.Model): if operator not in ('=', '!=', '<', '<=', '>', '>=', 'in', 'not in'): return [] # retrieve all the messages that match with a specific SQL query + self.flush(['body']) query = """SELECT id FROM "%s" WHERE char_length("body") %s %%s""" % \ (self._table, operator) self.env.cr.execute(query, (value,)) |
