summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_controller.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2019-02-06 09:43:34 +0000
committerAaron Bohy <aab@odoo.com>2019-02-06 14:03:25 +0000
commit495d475d1d3ab6726d7e5d5f2dd8044e60d1a3da (patch)
treee331e5bd0a35980f3164701071384bd65b661f30 /addons/web/static/src/js/views/basic/basic_controller.js
parent5fcf891e07bf61518e6bf0be0dc4f27859d45778 (diff)
[FIX] web: only call name_get when necessary
For many2one fields, 'default_get' only returns the id, whereas 'onchange' (like 'read') returns an array with id and display_name. Before this rev., when creating a new record, we always called 'name_get' for all many2ones, whether or not their value was obtained by 'default_get' or 'onchange', i.e. even if their display_name was already known. It may just look like unnecessary RPCs, but those RPCs could actually cause a crash when the user has access to the main model (and thus can access the display_name of the many2one thanks to related sudo), but doesn't have access to the many2one comodel. closes odoo/odoo#30892
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions