From 34d8762958b7c860db501df2611965d9838eeb2c Mon Sep 17 00:00:00 2001 From: roen-odoo Date: Mon, 9 May 2022 09:39:07 +0000 Subject: [PATCH] [FIX] point_of_sale: stop showing "select customer" popup twice Current behavior: When gift card module is activated for a certain PoS, and you use customer account as the payment method without selecting a customer the popup asking you to select a customer would appear 2 times. Steps to reproduce: - Activate gift cards for PoS A - Start session in PoS A - Add some products to the order - Don't set any customer - Go to the payment page - Select "Customer account" as payment method - Click on validate - A popup will appear asking you to select a customer - Click "Ok" - The popup appears again opw-2824675 closes odoo/odoo#91149 X-original-commit: bbb05cd9246b7478bcf1bb580dbe91ba4fb5856c Signed-off-by: Masereel Pierre Signed-off-by: Engels Robin (roen) --- addons/pos_loyalty/static/src/js/PaymentScreen.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/pos_loyalty/static/src/js/PaymentScreen.js b/addons/pos_loyalty/static/src/js/PaymentScreen.js index 002a4b5cab8..87b9052ebf9 100644 --- a/addons/pos_loyalty/static/src/js/PaymentScreen.js +++ b/addons/pos_loyalty/static/src/js/PaymentScreen.js @@ -31,8 +31,11 @@ export const PosLoyaltyPaymentScreen = (PaymentScreen) => pointChanges[line.coupon_id] -= line.points_cost; } } + if (!await this._isOrderValid(isForceValidate)) { + return; + } // No need to do an rpc if no existing coupon is being used. - if (await this._isOrderValid(isForceValidate) && (!_.isEmpty(pointChanges) || newCodes.length)) { + if (!_.isEmpty(pointChanges) || newCodes.length) { try { const {successful, payload} = await this.rpc({ model: 'pos.order',