From 399612c9dbb47b87df7c3584ce7b5aefe3b7ab7b Mon Sep 17 00:00:00 2001 From: jgallego Date: Tue, 9 Aug 2022 15:04:58 +0200 Subject: [PATCH] minor bug --- loopback/locale/es.json | 3 ++- modules/entry/back/methods/entry/recalcPrices.js | 4 ++-- modules/entry/front/descriptor/index.html | 4 +++- modules/entry/front/descriptor/index.js | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 38ac2d86c..b92164295 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -232,5 +232,6 @@ "Fichadas impares": "Fichadas impares", "Descanso diario 12h.": "Descanso diario 12h.", "Descanso semanal 36h. / 72h.": "Descanso semanal 36h. / 72h.", - "Dirección incorrecta": "Dirección incorrecta" + "Dirección incorrecta": "Dirección incorrecta", + "Prices recalculated": "Precios recalculados" } \ No newline at end of file diff --git a/modules/entry/back/methods/entry/recalcPrices.js b/modules/entry/back/methods/entry/recalcPrices.js index b9fd518f8..493e44e1e 100644 --- a/modules/entry/back/methods/entry/recalcPrices.js +++ b/modules/entry/back/methods/entry/recalcPrices.js @@ -27,6 +27,7 @@ module.exports = Self => { const myOptions = {}; const userId = ctx.req.accessToken.userId; const models = Self.app.models; + const $t = ctx.req.__; if (typeof options == 'object') Object.assign(myOptions, options); @@ -41,14 +42,13 @@ module.exports = Self => { id ], myOptions); */ - const oldProperties = await loggable.translateValues(Self, {price: 'Prices recalculated'}); const entryLog = await models.EntryLog.create({ originFk: id, userFk: userId, action: 'update', changedModel: 'Entry', changedModelId: id, - oldInstance: oldProperties + description: $t('Prices recalculated') }, myOptions); if (tx) await tx.commit(); diff --git a/modules/entry/front/descriptor/index.html b/modules/entry/front/descriptor/index.html index 4c7ea2476..cc9106e11 100644 --- a/modules/entry/front/descriptor/index.html +++ b/modules/entry/front/descriptor/index.html @@ -10,7 +10,9 @@ + translate + vn-acl="buyer" + vn-acl-action="remove"> Recalc prices diff --git a/modules/entry/front/descriptor/index.js b/modules/entry/front/descriptor/index.js index a3f8de62c..2d60336f9 100644 --- a/modules/entry/front/descriptor/index.js +++ b/modules/entry/front/descriptor/index.js @@ -93,7 +93,7 @@ class Controller extends Descriptor { recalcPrices() { this.$http.post(`Entries/${this.id}/recalcPrices`).then(() => { - this.vnApp.showSuccess(this.$t('Prices recalculated!')); + this.vnApp.showSuccess(this.$t('Prices recalculated')); }); } }