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 @@
{{ $t('components.contextMenuReferences') }}
-
+
{{ reference.displayName }}
diff --git a/src/components/ADempiere/Panel/index.vue b/src/components/ADempiere/Panel/index.vue
index 1c14b95f..1c3f5830 100644
--- a/src/components/ADempiere/Panel/index.vue
+++ b/src/components/ADempiere/Panel/index.vue
@@ -357,7 +357,7 @@ export default {
* TODO: Delete route parameters after reading them
*/
readParameters() {
- var parameters = {
+ const parameters = {
isLoadAllRecords: true,
isReference: false,
isNewRecord: false,
@@ -393,7 +393,11 @@ export default {
})
if (route.query.action && route.query.action === 'reference') {
- const referenceInfo = this.$store.getters.getReferencesInfo(route.query.windowUuid, route.query.recordUuid, route.query.referenceUuid)
+ const referenceInfo = this.$store.getters.getReferencesInfo({
+ windowUuid: this.parentUuid,
+ recordUuid: route.query.recordUuid,
+ referenceUuid: route.query.referenceUuid
+ })
route.params.isReadParameters = true
parameters.isLoadAllRecords = false
parameters.isReference = true
@@ -554,8 +558,8 @@ export default {
} else {
this.$router.push({
query: {
- action: 'create-new',
- ...this.$route.query
+ ...this.$route.query,
+ action: 'create-new'
}
})
}
@@ -639,8 +643,10 @@ export default {
}
}
if (this.isPanelWindow) {
- const tempRoute = Object.assign({}, this.$route, { title: `${this.tagTitle.base} - ${this.tagTitle.action}` })
- this.$store.dispatch('tagsView/updateVisitedView', tempRoute)
+ this.$store.dispatch('tagsView/updateVisitedView', {
+ ...this.$route,
+ title: `${this.tagTitle.base} - ${this.tagTitle.action}`
+ })
}
},
setData(dataTransfer) {
diff --git a/src/store/modules/ADempiere/windowControl.js b/src/store/modules/ADempiere/windowControl.js
index 016e3760..86b63df9 100644
--- a/src/store/modules/ADempiere/windowControl.js
+++ b/src/store/modules/ADempiere/windowControl.js
@@ -879,7 +879,7 @@ const windowControl = {
getReferencesList: (state) => (windowUuid, recordUuid) => {
return state.references.find(item => item.windowUuid === windowUuid && item.recordUuid === recordUuid)
},
- getReferencesInfo: (state, getters) => (windowUuid, recordUuid, referenceUuid) => {
+ getReferencesInfo: (state, getters) => ({ windowUuid, recordUuid, referenceUuid }) => {
const references = getters.getReferencesList(windowUuid, recordUuid)
return references.referencesList.find(item => item.uuid === referenceUuid)
},