From 902832ee79459b323caba9471c30d24d79710be2 Mon Sep 17 00:00:00 2001 From: Edwin Betancourt Date: Wed, 11 Mar 2020 21:36:44 -0400 Subject: [PATCH] fix: The references associated with a record are not displayed. (#396) --- .../ContextMenu/contextMenuDesktop.vue | 2 +- .../ADempiere/ContextMenu/contextMenuMixin.js | 50 +++++++++++-------- .../ContextMenu/contextMenuMobile.vue | 4 +- src/components/ADempiere/Panel/index.vue | 18 ++++--- src/store/modules/ADempiere/windowControl.js | 2 +- 5 files changed, 44 insertions(+), 32 deletions(-) diff --git a/src/components/ADempiere/ContextMenu/contextMenuDesktop.vue b/src/components/ADempiere/ContextMenu/contextMenuDesktop.vue index 2fcc1d0b..0f02a6af 100644 --- a/src/components/ADempiere/ContextMenu/contextMenuDesktop.vue +++ b/src/components/ADempiere/ContextMenu/contextMenuDesktop.vue @@ -97,7 +97,7 @@ v-for="(reference, index) in references.referencesList" :key="index" :index="reference.displayName" - @click="runAction(reference)" + @click="openReference(reference)" > {{ reference.displayName }} diff --git a/src/components/ADempiere/ContextMenu/contextMenuMixin.js b/src/components/ADempiere/ContextMenu/contextMenuMixin.js index 3a3b5867..8e0e6202 100644 --- a/src/components/ADempiere/ContextMenu/contextMenuMixin.js +++ b/src/components/ADempiere/ContextMenu/contextMenuMixin.js @@ -486,28 +486,6 @@ export const contextMixin = { } }) } - } else if (action.type === 'reference') { - if (action.windowUuid && action.recordUuid) { - const viewSearch = recursiveTreeSearch({ - treeData: this.permissionRoutes, - attributeValue: action.windowUuid, - attributeName: 'meta', - secondAttribute: 'uuid', - attributeChilds: 'children' - }) - if (viewSearch) { - this.$router.push({ - name: viewSearch.name, - query: { - action: action.type, - referenceUuid: action.uuid, - recordUuid: action.recordUuid, - windowUuid: this.parentUuid, - tabParent: 0 - } - }) - } - } } else if (action.type === 'updateReport') { var updateReportParams = { instanceUuid: action.instanceUuid, @@ -554,6 +532,34 @@ export const contextMixin = { }) } }, + openReference(referenceElement) { + if (referenceElement.windowUuid && referenceElement.recordUuid) { + const viewSearch = recursiveTreeSearch({ + treeData: this.permissionRoutes, + attributeValue: referenceElement.windowUuid, + attributeName: 'meta', + secondAttribute: 'uuid', + attributeChilds: 'children' + }) + if (viewSearch) { + this.$router.push({ + name: viewSearch.name, + query: { + action: referenceElement.type, + referenceUuid: referenceElement.uuid, + recordUuid: referenceElement.recordUuid, + // windowUuid: this.parentUuid, + tabParent: 0 + } + }) + } else { + this.showMessage({ + type: 'error', + message: this.$t('notifications.noRoleAccess') + }) + } + } + }, setShareLink() { let shareLink = this.panelType === 'window' || window.location.href.includes('?') ? `${window.location.href}&` : `${window.location.href}?` if (this.$route.name === 'Report Viewer') { diff --git a/src/components/ADempiere/ContextMenu/contextMenuMobile.vue b/src/components/ADempiere/ContextMenu/contextMenuMobile.vue index 33534fdb..f6a0ca99 100644 --- a/src/components/ADempiere/ContextMenu/contextMenuMobile.vue +++ b/src/components/ADempiere/ContextMenu/contextMenuMobile.vue @@ -97,13 +97,13 @@ -