From ee9feded0c232771e7afdb1125cc4b1b131bb7ad Mon Sep 17 00:00:00 2001 From: elsiosanchez <45974454+elsiosanchez@users.noreply.github.com> Date: Thu, 2 Apr 2020 04:03:06 -0400 Subject: [PATCH] error requests when advanced query (#424) * current record request in the container info * Delete unnecessary console --- src/components/ADempiere/Panel/index.vue | 2 ++ src/store/modules/ADempiere/utils.js | 12 +++++++++++- src/store/modules/ADempiere/windowControl.js | 18 ++++++------------ src/views/ADempiere/Window/index.vue | 6 ++++++ 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/components/ADempiere/Panel/index.vue b/src/components/ADempiere/Panel/index.vue index 8b9bc890..8425e2d8 100644 --- a/src/components/ADempiere/Panel/index.vue +++ b/src/components/ADempiere/Panel/index.vue @@ -675,6 +675,8 @@ export default { } this.setTagsViewTitle(uuidRecord) this.setFocus() + const currentRecord = this.getterDataStore.record.find(record => record.UUID === uuidRecord) + this.$store.dispatch('currentRecord', currentRecord) }, async setFocus() { return new Promise(resolve => { diff --git a/src/store/modules/ADempiere/utils.js b/src/store/modules/ADempiere/utils.js index 7998a840..6ffd8a6a 100644 --- a/src/store/modules/ADempiere/utils.js +++ b/src/store/modules/ADempiere/utils.js @@ -28,7 +28,8 @@ const initStateUtils = { isReaded: false, isLoaded: false }, - panelRight: '' + panelRight: '', + currentRecord: {} } const utils = { @@ -97,6 +98,9 @@ const utils = { }, resetStateUtils(state) { state = initStateUtils + }, + setCurrentRecor(state, payload) { + state.currentRecord = payload } }, actions: { @@ -160,6 +164,9 @@ const utils = { }, setPanelRight({ commit }, panelRight) { commit('setPanelRight', panelRight) + }, + currentRecord({ commit }, record) { + commit('setCurrentRecor', record) } }, getters: { @@ -232,6 +239,9 @@ const utils = { }, getPanelRight: (state) => { return state.panelRight + }, + getCurrentRecord: (state) => { + return state.currentRecord } } } diff --git a/src/store/modules/ADempiere/windowControl.js b/src/store/modules/ADempiere/windowControl.js index 94327987..030f1513 100644 --- a/src/store/modules/ADempiere/windowControl.js +++ b/src/store/modules/ADempiere/windowControl.js @@ -289,12 +289,6 @@ const windowControl = { } return true }) - // if (rootGetters.getShowContainerInfo) { - // dispatch('listRecordLogs', { - // tableName: panel.tableName, - // recordId - // }) - // } return updateEntity({ tableName: panel.tableName, recordUuid, @@ -327,12 +321,12 @@ const windowControl = { recordUuid, eventType: 'UPDATE' }) - // if (containerInfo) { - dispatch('listRecordLogs', { - tableName: panel.tableName, - recordId - }) - // } + if (rootGetters.getShowContainerInfo) { + dispatch('listRecordLogs', { + tableName: panel.tableName, + recordId + }) + } return newValues }) .catch(error => { diff --git a/src/views/ADempiere/Window/index.vue b/src/views/ADempiere/Window/index.vue index cbed68cd..22800492 100644 --- a/src/views/ADempiere/Window/index.vue +++ b/src/views/ADempiere/Window/index.vue @@ -529,6 +529,12 @@ export default { }) return record }, + getCurrentRecord() { + if (this.isEmptyValue(this.$store.getters.getCurrentRecord)) { + return this.getterDataRecords[0] + } + return this.$store.getters.getCurrentRecord + }, isWorkflowBarStatus() { const panel = this.$store.getters.getPanel(this.windowMetadata.currentTabUuid) if (!this.isEmptyValue(panel) && panel.isDocument && this.$route.meta.type === 'window' && this.$route.query.action !== 'create-new') {