From c7b94523c0cd7d8a49380138220d86aa9ca22604 Mon Sep 17 00:00:00 2001 From: Elsio Sanchez <45974454+elsiosanchez@users.noreply.github.com> Date: Tue, 11 May 2021 19:30:35 -0400 Subject: [PATCH] Fix Message Record Access (#835) * Support Lock Record * fix Record Acces Co-authored-by: elsiosanchez --- src/components/ADempiere/Tab/index.vue | 14 ++++++++------ src/lang/ADempiere/en.js | 6 +++++- src/lang/ADempiere/es.js | 7 ++++++- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/components/ADempiere/Tab/index.vue b/src/components/ADempiere/Tab/index.vue index 57e1c164..804fb815 100644 --- a/src/components/ADempiere/Tab/index.vue +++ b/src/components/ADempiere/Tab/index.vue @@ -29,12 +29,14 @@ :style="tabParentStyle" > - + - {{ tabAttributes.name }} + + {{ tabAttributes.name }} + {{ tabAttributes.name }} @@ -126,26 +128,26 @@ export default { }, methods: { lockRecord() { - this.lock = !this.lock const tableName = this.windowMetadata.firstTab.tableName const action = this.lock ? 'lockRecord' : 'unlockRecord' - const message = !this.lock ? 'lockRecord' : 'unlockRecord' this.$store.dispatch(action, { tableName, recordId: this.record[tableName + '_ID'], recordUuid: this.record.UUID }) .then(() => { + this.lock = !this.lock this.$message({ type: 'success', - message: this.$t('data.' + message), + message: this.$t('data.notification.' + action), showClose: true }) }) .catch(() => { + this.lock = !this.lock this.$message({ type: 'error', - message: this.$t('data.isError') + this.$t('data.' + message), + message: this.$t('data.isError') + this.$t('data.' + action), showClose: true }) }) diff --git a/src/lang/ADempiere/en.js b/src/lang/ADempiere/en.js index a560942d..b87b0fcb 100644 --- a/src/lang/ADempiere/en.js +++ b/src/lang/ADempiere/en.js @@ -366,7 +366,11 @@ export default { }, selectionRequired: 'You must select a record', undo: 'Undo', - unlockRecord: 'Unlock Record' + unlockRecord: 'Unlock Record', + notification: { + lockRecord: 'The Registry was Locked', + unlockRecord: 'Registry was Unlocked' + } }, sequence: { available: 'Available', diff --git a/src/lang/ADempiere/es.js b/src/lang/ADempiere/es.js index 20fd6415..1df5113f 100644 --- a/src/lang/ADempiere/es.js +++ b/src/lang/ADempiere/es.js @@ -342,7 +342,12 @@ export default { }, selectionRequired: 'Debe seleccionar un registro', undo: 'Deshacer', - unlockRecord: 'Registro Desbloqueado' + unlockRecord: 'Desbloquear Registro', + notification: { + lockRecord: 'El Registro fue Bloqueado', + unlockRecord: 'El Registro fue Desbloqueado' + } + }, sequence: { available: 'Disponibles',