This commit is contained in:
Yuri Kuznetsov
2025-06-27 19:14:12 +03:00
parent d24abb2435
commit b48827376f
+17 -19
View File
@@ -382,44 +382,42 @@ class LayoutDetailView extends LayoutGridView {
const fieldList = [];
layout.forEach(panel => {
panel.rows.forEach(row => {
row.forEach(cell => {
if (cell !== false && cell !== null) {
if (cell.name) {
fieldList.push(cell.name);
}
for (const panel of layout) {
for (const row of panel.rows) {
for (const cell of row) {
if (cell !== false && cell !== null && cell.name) {
fieldList.push(cell.name);
}
});
});
});
}
}
}
let incompatibleFieldList = [];
let isIncompatible = false;
fieldList.forEach(field => {
if (isIncompatible) {
return;
}
for (const field of fieldList) {
const defs = /** @type {Record} */
this.getMetadata().get(['entityDefs', this.scope, 'fields', field]) || {};
this.getMetadata().get(['entityDefs', this.scope, 'fields', field]) ?? {};
const targetFieldList = defs.detailLayoutIncompatibleFieldList || [];
const targetFieldList = defs.detailLayoutIncompatibleFieldList ?? [];
targetFieldList.forEach(itemField => {
if (isIncompatible) {
return;
}
if (~fieldList.indexOf(itemField)) {
if (fieldList.includes(itemField)) {
isIncompatible = true;
incompatibleFieldList = [field].concat(targetFieldList);
}
});
});
if (isIncompatible) {
break;
}
}
if (isIncompatible) {
Espo.Ui.error(