diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-01-04 14:54:08 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-01-04 14:54:08 +0100 |
| commit | ec9400821ecf45d9495740ebcea9e213ef12d3fe (patch) | |
| tree | 93a7753a321f05fe5fcd88b67e5e29034f5107e7 /addons/web/static/src/js/views/basic/basic_view.js | |
| parent | 2cdc1cc9ced4364cac403fd0891836dba52bdd08 (diff) | |
| parent | 27a084eb814acd81679db1e461c53389d6afc875 (diff) | |
[MERGE] forward port branch saas-11.3 up to 27a084eb814
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 | 15 |
1 files changed, 15 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 eb3efe7001d..55fd73eeb50 100644 --- a/addons/web/static/src/js/views/basic/basic_view.js +++ b/addons/web/static/src/js/views/basic/basic_view.js @@ -148,6 +148,21 @@ var BasicView = AbstractView.extend({ if (_.difference(fieldViewTypes, recordViewTypes).length) { fieldNames.push(name); } + + if (record.data[name].viewType === 'default') { + // Use case: x2many (tags) in x2many list views + // When opening the x2many record form view, the + // x2many will be reloaded but it may not have + // the same fields (ex: tags in list and list in + // form) so we need to merge the fieldsInfo to + // avoid losing the initial fields (display_name) + var defaultFieldInfo = record.data[name].fieldsInfo.default; + _.each(fieldViews, function (fieldView) { + _.each(fieldView.fieldsInfo, function (x2mFieldInfo) { + _.defaults(x2mFieldInfo, defaultFieldInfo); + }); + }); + } } } // Many2one: context is not the same between the different views |
