diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2018-04-19 18:01:27 +0200 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2018-04-20 10:54:29 +0200 |
| commit | 96ce375c610d2ddcaf801340603afc139069ace5 (patch) | |
| tree | 0272abaace3892fdb1f8c15432ed61d253b0a04f /addons/web/static/src/js/views/basic/basic_controller.js | |
| parent | 9daf3f85a8a3b012a79226fe13d3cde2293fcce0 (diff) | |
[FIX] models: more than one prefetch in onchange
When a record fields are prefetched, the currently accessed record is
prefetched as well as PREFETCH_MAX (=1000) minus currenly accessed
records.
Since 439fa826 the id field was thought as "prefetched" but was not,
which caused that in an onchange, we would have a prefetching as follow
for 1200 records:
- get records 1-1000
- get record 1001 (1001-1200 INTERSECTION 1-999 (id) + 1001 (current))
- get record 1002 (1002-1200 INTERSECTION 1-999 (id) + 1002 (current))
- get record 1003 (1003-1200 INTERSECTION 1-999 (id) + 1003 (current))
- ...
- get record 1200 (1200 INTERSECTION 1-999 (id) + 1200 (current))
So we would do 201 queries instead of 2 when prefetching the records.
The added test without this change failed the query count with:
"AssertionError: 284 not less than or equal to 5 : admin"
opw-1837548
opw-1837552
closes #24326
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions
