diff --git a/application/Espo/Resources/metadata/clientDefs/Template.json b/application/Espo/Resources/metadata/clientDefs/Template.json index 6019296f92..6f3a7fbd98 100644 --- a/application/Espo/Resources/metadata/clientDefs/Template.json +++ b/application/Espo/Resources/metadata/clientDefs/Template.json @@ -6,6 +6,16 @@ }, "dynamicLogic": { "fields": { + "entityType": { + "readOnly": { + "conditionGroup": [ + { + "type": "isNotEmpty", + "attribute": "id" + } + ] + } + }, "footer": { "visible": { "conditionGroup": [ diff --git a/client/src/views/template/record/detail.js b/client/src/views/template/record/detail.js index a3398e8338..d14a827d61 100644 --- a/client/src/views/template/record/detail.js +++ b/client/src/views/template/record/detail.js @@ -26,17 +26,13 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -Espo.define('views/template/record/detail', 'views/record/detail', function (Dep) { +define('views/template/record/detail', 'views/record/detail', function (Dep) { return Dep.extend({ setup: function () { Dep.prototype.setup.call(this); - if (!this.model.isNew()) { - this.setFieldReadOnly('entityType'); - } - this.hideField('variables'); this.on('after:set-edit-mode', function () { @@ -45,8 +41,7 @@ Espo.define('views/template/record/detail', 'views/record/detail', function (Dep this.on('after:set-detail-mode', function () { this.hideField('variables'); }, this); - } + }, }); - }); diff --git a/client/src/views/template/record/edit.js b/client/src/views/template/record/edit.js index b7b927ddf4..460c6cd903 100644 --- a/client/src/views/template/record/edit.js +++ b/client/src/views/template/record/edit.js @@ -26,7 +26,7 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -Espo.define('views/template/record/edit', 'views/record/edit', function (Dep) { +define('views/template/record/edit', 'views/record/edit', function (Dep) { return Dep.extend({ @@ -115,8 +115,7 @@ Espo.define('views/template/record/edit', 'views/record/edit', function (Dep) { }; }, this); } - } + }, }); - });