From e6fa56322262239c40def1ddb945e2f8b8edb796 Mon Sep 17 00:00:00 2001 From: Jason Van Malder Date: Wed, 4 Dec 2019 12:04:51 +0000 Subject: [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) --- addons/web/static/src/js/views/basic/basic_model.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/views/basic/basic_model.js') 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])); -- cgit v1.2.3