summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_model.js
diff options
context:
space:
mode:
authorRaphael Collet <rco@odoo.com>2018-11-22 14:32:11 +0000
committerRaphael Collet <rco@odoo.com>2018-11-23 11:18:19 +0000
commit499cdd57083da462eec0a66bf76be18a3c703101 (patch)
tree728ea9298a5865638e94412231f7b6ca338b74fc /addons/web/static/src/js/views/basic/basic_model.js
parent264f89f63f89678b01a75a20b508dd10018b00d8 (diff)
[FIX] fields: combine special values during onchange
Consider a many2one field `foo_id` on model `bar`, with an inverse one2many field `bar_ids` on model `foo`. During an onchange, the statement bar.foo_id = foo puts a special value in cache to add `bar` to the value of `foo.bar_ids` without explicitly reading `foo.bar_ids`. Executing the above statement a second time, the cache of `foo.bar_ids` is no longer empty. This causes the actual value of `foo.bar_ids` to be read and updated. The issue is that this can be slow for large values of `foo.bar_ids`. Avoid reading the value of the one2many field by handling the case where the cache contains the special value: simply update the special value to take into account the second assignment. closes odoo/odoo#28982
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_model.js')
0 files changed, 0 insertions, 0 deletions