Skip to content

EspoCRM – Open Source CRM Application

ref

Yurii25fbf66a7079
diff --git a/client/src/views/record/panels/relationship.js b/client/src/views/record/panels/relationship.js
index 93481efbf7..12b50cc621 100644
--- a/client/src/views/record/panels/relationship.js
+++ b/client/src/views/record/panels/relationship.js
@@ -363,50 +363,50 @@ class RelationshipPanelView extends BottomPanelView {
this.listViewName = viewName;
this.rowActionsView = this.defs.readOnly ? false : (this.defs.rowActionsView || this.rowActionsView);
- this.once('after:render', () => {
- this.createView('list', viewName, {
- collection: collection,
- layoutName: layoutName,
- listLayout: listLayout,
- checkboxes: false,
- rowActionsView: this.rowActionsView,
- buttonsDisabled: true,
- selector: '.list-container',
- skipBuildRows: true,
- rowActionsOptions: {
- unlinkDisabled: this.defs.unlinkDisabled,
- editDisabled: this.defs.editDisabled,
- removeDisabled: this.defs.removeDisabled,
- },
- displayTotalCount: false,
- additionalRowActionList: this.defs.rowActionList,
- }, view => {
- view.getSelectAttributeList(selectAttributeList => {
- if (selectAttributeList) {
- if (this.defs.mandatoryAttributeList) {
- selectAttributeList = [...selectAttributeList, ...this.defs.mandatoryAttributeList];
+ this.once('after:render', async () => {
+ const view = /** @type {import('views/record/list').default} */
+ await this.createView('list', viewName, {
+ collection: collection,
+ layoutName: layoutName,
+ listLayout: listLayout,
+ checkboxes: false,
+ rowActionsView: this.rowActionsView,
+ buttonsDisabled: true,
+ selector: '.list-container',
+ skipBuildRows: true,
+ rowActionsOptions: {
+ unlinkDisabled: this.defs.unlinkDisabled,
+ editDisabled: this.defs.editDisabled,
+ removeDisabled: this.defs.removeDisabled,
+ },
+ displayTotalCount: false,
+ additionalRowActionList: this.defs.rowActionList,
+ });
- selectAttributeList = selectAttributeList
- .filter((it, i) => selectAttributeList.indexOf(it) === i);
+ let selectAttributeList = await view.getSelectAttributeList();
- }
+ if (selectAttributeList) {
+ if (this.defs.mandatoryAttributeList) {
+ selectAttributeList = [...selectAttributeList, ...this.defs.mandatoryAttributeList];
- collection.data.select = selectAttributeList.join(',');
- }
+ selectAttributeList = selectAttributeList
+ .filter((it, i) => selectAttributeList.indexOf(it) === i);
+ }
- if (!this.defs.hidden) {
- collection.fetch();
+ collection.data.select = selectAttributeList.join(',');
+ }
- return;
- }
+ if (!this.defs.hidden) {
+ collection.fetch();
- this.once('show', () => collection.fetch());
- });
+ return;
+ }
- if (this.defs.syncBackWithModel) {
- this.listenTo(view, 'after:save after:delete', () => this.processSyncBack());
- }
- });
+ this.once('show', () => collection.fetch());
+
+ if (this.defs.syncBackWithModel) {
+ this.listenTo(view, 'after:save after:delete', () => this.processSyncBack());
+ }
});
this.wait(false);