summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_controller.js
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2018-04-19 18:01:27 +0200
committerNicolas Lempereur <nle@odoo.com>2018-04-20 10:54:29 +0200
commit96ce375c610d2ddcaf801340603afc139069ace5 (patch)
tree0272abaace3892fdb1f8c15432ed61d253b0a04f /addons/web/static/src/js/views/basic/basic_controller.js
parent9daf3f85a8a3b012a79226fe13d3cde2293fcce0 (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