From 7062aed4e9920c8a7dc122bad1baeeda00c1d89f Mon Sep 17 00:00:00 2001 From: IEL Date: Fri, 6 Nov 2020 16:43:43 +0000 Subject: [FIX] payment: prevent changing checkout options STEPS: * install website_sale * setup few delivery options * setup online payment (e.g. paypal) * at website add products to cart and proceed to checkout page * slow down internet speed * click "Pay now" BEFORE: while it's loading, you can change delivery option. So, you have SO changed, while in payment page you see old total amount AFTER: it's not possible to change delivery options through UI Note that it is not possible to pay less that what you should at anyway. opw-2324543 closes odoo/odoo#61721 X-original-commit: eb3ed89f8440050fc32f9a7b29fb2b6ab8fd6b59 Signed-off-by: Romain Derie Co-authored-by: Romain Derie --- addons/payment/static/src/js/payment_form.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/payment/static/src/js/payment_form.js b/addons/payment/static/src/js/payment_form.js index 2138082f1de..e8d6d784cea 100644 --- a/addons/payment/static/src/js/payment_form.js +++ b/addons/payment/static/src/js/payment_form.js @@ -130,12 +130,14 @@ publicWidget.registry.PaymentForm = publicWidget.Widget.extend({ }, disableButton: function (button) { + $("body").block({overlayCSS: {backgroundColor: "#000", opacity: 0, zIndex: 1050}, message: false}); $(button).attr('disabled', true); $(button).children('.fa-lock').removeClass('fa-lock'); $(button).prepend(' '); }, enableButton: function (button) { + $('body').unblock(); $(button).attr('disabled', false); $(button).children('.fa').addClass('fa-lock'); $(button).find('span.o_loader').remove(); -- cgit v1.2.3