Skip to content

EspoCRM – Open Source CRM Application

no customization for utility field

Yuri Kuznetsovcce7ddbff20c
diff --git a/client/src/views/admin/field-manager/edit.js b/client/src/views/admin/field-manager/edit.js
index 79d6225fba..654523edee 100644
--- a/client/src/views/admin/field-manager/edit.js
+++ b/client/src/views/admin/field-manager/edit.js
@@ -320,11 +320,12 @@ class FieldManagerEditView extends View {
return !(this.globalRestriction.readOnly && item.name === 'required');
});
- const customizationDisabled = this.getMetadata()
- .get(['entityDefs', this.scope, 'fields', this.field, 'customizationDisabled']);
+ /** @type {Record} */
+ const fieldDefs = this.getMetadata().get(['entityDefs', this.scope, 'fields', this.field]) ?? {};
if (
- customizationDisabled ||
+ fieldDefs.customizationDisabled ||
+ fieldDefs.utility ||
this.globalRestriction.forbidden
) {
this.paramList = [];
diff --git a/client/src/views/admin/field-manager/list.js b/client/src/views/admin/field-manager/list.js
index 0c6bff68a6..d94b98fd9d 100644
--- a/client/src/views/admin/field-manager/list.js
+++ b/client/src/views/admin/field-manager/list.js
@@ -98,9 +98,23 @@ class FieldManagerListView extends View {
isCustom: defs.isCustom || false,
type: defs.type,
label: this.translate(field, 'fields', this.scope),
- isEditable: !defs.customizationDisabled && this.isCustomizable,
+ isEditable: !defs.customizationDisabled &&
+ !defs.utility &&
+ this.isCustomizable,
});
});
+
+ this.fieldDefsArray = this.fieldDefsArray.sort((a, b) => {
+ if (a.isEditable && !b.isEditable) {
+ return -1;
+ }
+
+ if (!a.isEditable && b.isEditable) {
+ return 1;
+ }
+
+ return 0;
+ })
});
}