diff options
| author | len-odoo <len@odoo.com> | 2018-10-30 10:16:09 +0000 |
|---|---|---|
| committer | len-odoo <len@odoo.com> | 2018-10-31 12:52:36 +0000 |
| commit | 180f5285286c6bf4753935680fb493d4b5e04a36 (patch) | |
| tree | 5d78b960ef6e3d0a9aeaab18e8d64a469e333d92 /addons/web/static/src/js/views/basic/basic_view.js | |
| parent | a219bdb85e9078f88bb5a7b43b3598762a7bd819 (diff) | |
[FIX] web: reload many2one data if the context has changed
When a view is loaded, it checks which fields it has to load.
In the case of a many2one, it could be the case that a context key is present in
one view and not in the other; if it happens, we should reload the data, as a
name_get result could vary.
opw 1891295
closes odoo/odoo#28298
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_view.js')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_view.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_view.js b/addons/web/static/src/js/views/basic/basic_view.js index c76020cacac..cdb1cc05290 100644 --- a/addons/web/static/src/js/views/basic/basic_view.js +++ b/addons/web/static/src/js/views/basic/basic_view.js @@ -109,6 +109,14 @@ var BasicView = AbstractView.extend({ } } } + // Many2one: context is not the same between the different views + // this means the result of a name_get could differ + if (fieldType === 'many2one') { + if (JSON.stringify(record.data[name].context) !== + JSON.stringify(fieldInfo.context)) { + fieldNames.push(name); + } + } } }); |
