diff options
| author | Raphael Collet <rco@odoo.com> | 2020-01-09 10:48:26 +0000 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2020-01-20 13:43:29 +0000 |
| commit | 238e7436ed3c6bc80a3c69fff5a4ef8fa0b90ae7 (patch) | |
| tree | 7a6d091a281fed590f3548250982b6bd7375e451 /addons/web/static/src/js/views/basic/basic_controller.js | |
| parent | 029ee8dc0d9ab9c89cbd91279e1e8a7d36faad8e (diff) | |
[FIX] expression: performance of search on one2many fields
We optimize the search on domains like `[('line_ids', 'in', ids)]`.
The condition is rewritten `('id', 'in', ids1)` where `ids1` is the
result of
SELECT <many2one_field> FROM <comodel_table> WHERE id IN <ids>
The issue is that the latter potentially returns many duplicate values.
The fix consists in having as few duplicates as possible in `ids1`.
Note that domains like `[('line_ids.foo', '=', 42)]` implicitly benefit
from the optimization, as they are rewritten as the one above with
ids = comodel.search([('foo', '=', 42)]).ids
closes odoo/odoo#43574
X-original-commit: a13c05fa5df9c98504e8e1cdb09d8d4a8d13ea91
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions
