diff --git a/addons/payment/static/src/js/checkout_form.js b/addons/payment/static/src/js/checkout_form.js index aa321e6561c..29c787bd253 100644 --- a/addons/payment/static/src/js/checkout_form.js +++ b/addons/payment/static/src/js/checkout_form.js @@ -74,6 +74,10 @@ odoo.define('payment.checkout_form', require => { // Make the payment this._hideError(); // Don't keep the error displayed if the user is going through 3DS2 this._disableButton(true); // Disable until it is needed again + $('body').block({ + message: false, + overlayCSS: {backgroundColor: "#000", opacity: 0, zIndex: 1050}, + }); this._processPayment(provider, paymentOptionId, flow); }, diff --git a/addons/payment/static/src/js/manage_form.js b/addons/payment/static/src/js/manage_form.js index a8c153816f7..e6a4e840ffa 100644 --- a/addons/payment/static/src/js/manage_form.js +++ b/addons/payment/static/src/js/manage_form.js @@ -206,6 +206,10 @@ odoo.define('payment.manage_form', require => { // Save the payment method this._hideError(); // Don't keep the error displayed if the user is going through 3DS2 this._disableButton(true); // Disable until it is needed again + $('body').block({ + message: false, + overlayCSS: {backgroundColor: "#000", opacity: 0, zIndex: 1050}, + }); if (flow !== 'token') { // Creation of a new token this.txContext.tokenizationRequested = true; this.txContext.isValidation = true; diff --git a/addons/payment/static/src/js/payment_form_mixin.js b/addons/payment/static/src/js/payment_form_mixin.js index 36ba8911c57..890f2b08ef2 100644 --- a/addons/payment/static/src/js/payment_form_mixin.js +++ b/addons/payment/static/src/js/payment_form_mixin.js @@ -104,6 +104,7 @@ odoo.define('payment.payment_form_mixin', require => { .scrollIntoView({behavior: 'smooth', block: 'center'}); } this._enableButton(); // Enable button back after it was disabled before processing + $('body').unblock(); // The page is blocked at this point, unblock it }, /** diff --git a/addons/payment_adyen/static/src/js/payment_form.js b/addons/payment_adyen/static/src/js/payment_form.js index 0a91c61ba1e..d0221ef4794 100644 --- a/addons/payment_adyen/static/src/js/payment_form.js +++ b/addons/payment_adyen/static/src/js/payment_form.js @@ -196,7 +196,7 @@ odoo.define('payment_adyen.payment_form', require => { * @param {string} flow - The online payment flow of the transaction * @return {Promise} */ - _processPayment: function (provider, paymentOptionId, flow) { + async _processPayment(provider, paymentOptionId, flow) { if (provider !== 'adyen' || flow === 'token') { return this._super(...arguments); // Tokens are handled by the generic flow } @@ -205,7 +205,7 @@ odoo.define('payment_adyen.payment_form', require => { _t("Server Error"), _t("We are not able to process your payment.") ); } else { - return this.adyenDropin.submit(); + return await this.adyenDropin.submit(); } }, diff --git a/addons/payment_authorize/static/src/js/payment_form.js b/addons/payment_authorize/static/src/js/payment_form.js index 722a22b596f..61b39bb3dff 100644 --- a/addons/payment_authorize/static/src/js/payment_form.js +++ b/addons/payment_authorize/static/src/js/payment_form.js @@ -130,6 +130,7 @@ odoo.define('payment_authorize.payment_form', require => { if (!this._validateFormInputs(paymentOptionId)) { this._enableButton(); // The submit button is disabled at this point, enable it + $('body').unblock(); // The page is blocked at this point, unblock it return Promise.resolve(); } diff --git a/addons/website_sale/static/src/js/website_sale_payment.js b/addons/website_sale/static/src/js/website_sale_payment.js index 93109926fd1..3420d1b8a0f 100644 --- a/addons/website_sale/static/src/js/website_sale_payment.js +++ b/addons/website_sale/static/src/js/website_sale_payment.js @@ -53,26 +53,6 @@ odoo.define('website_sale.payment', require => { // Private //---------------------------------------------------------------------- - /** - * @override - */ - _disableButton(showLoadingAnimation = true) { - $("body").block({ - message: false, - overlayCSS: {backgroundColor: "#000", opacity: 0, zIndex: 1050}, - }); - this._super(...arguments); - }, - /** - * @override - */ - _enableButton() { - const res = this._super(...arguments); - if (res) { - $('body').unblock(); - } - return res; - }, /** * Verify that the Terms and Condition checkbox is checked. *