[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) <anv@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
This commit is contained in:
Walid
2024-03-31 14:01:54 +00:00
parent 128475bf2a
commit 2eeb837913
@@ -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(