From 2eeb8379133eb6ffd8aa1460a97c3b3832a6b2f7 Mon Sep 17 00:00:00 2001 From: Walid Date: Wed, 27 Mar 2024 13:40:35 +0100 Subject: [PATCH] [FIX] website_sale: Terms and conditions keep button disabled Steps to reproduce: - Setup sendcloud shipping (shipping product 10-30KG) - Enable demo payment - On the website proceed to checkout (customizable desk) - Select sendcloud (Pay button is disabled) - Edit website and add terms and conditions - Now if you uncheck and recheck terms and conditions - Pay button is enabled although carrier is in error Fix: when reenabling the pay button we check that the carrier is ready but we only check if there's pickup point ensure that the shipping method is avialable before enabling the pay button opw-3698804 closes odoo/odoo#159539 X-original-commit: 7682c4bfc7a15b27e95905a2a0d909278bec9eb6 Signed-off-by: Antoine Vandevenne (anv) Signed-off-by: Walid Hanniche (waha) --- addons/website_sale/static/src/js/payment_button.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/website_sale/static/src/js/payment_button.js b/addons/website_sale/static/src/js/payment_button.js index 3cc0da7e06a..c36cca81bd3 100644 --- a/addons/website_sale/static/src/js/payment_button.js +++ b/addons/website_sale/static/src/js/payment_button.js @@ -35,6 +35,10 @@ paymentButton.include({ return false; // Nothing else to check. } const carriersContainer = checkedCarriers[0].closest('.o_delivery_carrier_select'); + if (carriersContainer.querySelector('.o_wsale_delivery_carrier_error')) { + // Rate shipment error. + return false; + } const isPickUpPointRequired = carriersContainer.querySelector('.o_show_pickup_locations'); if (isPickUpPointRequired) { const address = carriersContainer.querySelector(