summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorJason Van Malder <jvm@odoo.com>2019-12-04 12:04:51 +0000
committerNicolas Martinelli <nim@odoo.com>2020-01-21 18:14:23 +0000
commite6fa56322262239c40def1ddb945e2f8b8edb796 (patch)
tree49a37a934003196724b7a301838cf6c785fb17cf /addons/web/static/src/js
parent13c1f4fa3478d17dc62309d6af02bbd361e672ce (diff)
[FIX] web: fix studio child view datapoint content
Issue - Install Employees & Studio - Configuration > Check Skills Management - Go on an employee form - Remove all data in Experience, Education & Skills - Open Studio - Click in the blank space before Skills - Edit Form View Traceback Cause The ORM tries to get the parent fields because the generated datapoint includes them. (45bc7c9) Normally the parent model is the same than the child model but not in studio. Solution Merging the fields in the datapoint only if the models are the same. OPW-2125214 closes odoo/odoo#43695 X-original-commit: d2dbc4faaad0988d71f591be7f50c94d455541b0 Related: odoo/enterprise#7849 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/views/basic/basic_model.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js
index e43c7f2a0e6..ca4d54a16ff 100644
--- a/addons/web/static/src/js/views/basic/basic_model.js
+++ b/addons/web/static/src/js/views/basic/basic_model.js
@@ -3980,7 +3980,8 @@ var BasicModel = AbstractModel.extend({
// Fields that are present in the originating view, that need to be initialized
// Hence preventing their value to crash when getting back to the originating view
- var parentRecord = self.localData[params.parentID];
+ var parentRecord = params.parentID && this.localData[params.parentID].type === 'list' ? this.localData[params.parentID] : null;
+
if (parentRecord) {
var originView = parentRecord.viewType;
fieldNames = _.union(fieldNames, Object.keys(parentRecord.fieldsInfo[originView]));