From bb5ee0106ec2c8cf8f0bd1a971e24a2fc414bb60 Mon Sep 17 00:00:00 2001 From: Daniel Duque Date: Tue, 4 Apr 2023 16:32:05 +0200 Subject: [PATCH] [FIX] l10n_es_pos: validation Change made in 1baf50b avoids showing customer popup on orders above limit (invoiced). Moving back logic to `validateOrder` fixes this problem. --- l10n_es_pos/static/src/js/PaymentScreen.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_es_pos/static/src/js/PaymentScreen.js b/l10n_es_pos/static/src/js/PaymentScreen.js index 2cbf934029c..f48fabad54d 100644 --- a/l10n_es_pos/static/src/js/PaymentScreen.js +++ b/l10n_es_pos/static/src/js/PaymentScreen.js @@ -13,7 +13,7 @@ odoo.define("l10n_es_pos.PaymentScreen", function (require) { // eslint-disable-next-line no-shadow const L10nEsPosPaymentScreen = (PaymentScreen) => class extends PaymentScreen { - async _finalizeValidation() { + async validateOrder(isForceValidate) { const below_limit = this.currentOrder.get_total_with_tax() <= this.env.pos.config.l10n_es_simplified_invoice_limit; @@ -26,7 +26,7 @@ odoo.define("l10n_es_pos.PaymentScreen", function (require) { order.to_invoice = true; } } - super._finalizeValidation(); + await super.validateOrder(isForceValidate); } };