Skip to content

EspoCRM – Open Source CRM Application

set read only fix

Yuri Kuznetsov6e1786d00022
diff --git a/client/src/views/fields/base.js b/client/src/views/fields/base.js
index e03aa158ad..97459c97ba 100644
--- a/client/src/views/fields/base.js
+++ b/client/src/views/fields/base.js
@@ -452,7 +452,7 @@ class BaseFieldView extends View {
}
if (!this.isReady) {
- if (!this.mode) {
+ if (!this.mode || !this._initCalled) {
this.mode = 'detail';
return Promise.resolve();
@@ -723,6 +723,12 @@ class BaseFieldView extends View {
return this.prepare();
}
+ /**
+ * @private
+ * @type {boolean}
+ */
+ _initCalled = false
+
/** @inheritDoc */
init() {
this.validations = Espo.Utils.clone(this.validations);
@@ -801,6 +807,8 @@ class BaseFieldView extends View {
this.mode = undefined;
+ this._initCalled = true;
+
this.wait(
this.setMode(mode)
);