From 1a299e883368a8c5289cb80f5ec9b2e52b0b583e Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 6 Feb 2019 14:55:18 +0000 Subject: [PATCH] [FIX] auth_signup: properly disable sign up button on click The feature introduced with https://github.com/odoo/odoo/commit/67d1173bf381befc136d840e232514c2c9ef7e1b was broken by https://github.com/odoo/odoo/commit/b78b9c87c95acdf6fcf4f4eb3a80efa0e90eae09#diff-2d8ecbf95567bb339109e9552cbc68a3 because a class was removed by mistake. This commit does not reintroduce the class so that no view is modified in stable versions but rather review the JS to target the same button another way. Bug revealed while working on https://github.com/odoo/odoo/pull/29442 closes odoo/odoo#30896 --- addons/auth_signup/static/src/js/signup.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/auth_signup/static/src/js/signup.js b/addons/auth_signup/static/src/js/signup.js index fc35d689d8a..0e97844c1fa 100644 --- a/addons/auth_signup/static/src/js/signup.js +++ b/addons/auth_signup/static/src/js/signup.js @@ -6,9 +6,11 @@ var base = require('web_editor.base'); base.ready().then(function() { // Disable 'Sign Up' button to prevent user form continuous clicking if ($('.oe_signup_form').length > 0) { - $('.oe_signup_form').on('submit', function () { - $('.o_signup_btn').attr('disabled', 'disabled'); - $('.o_signup_btn').prepend(' '); + $('.oe_signup_form').on('submit', function (ev) { + var $form = $(ev.currentTarget); + var $btn = $form.find('.oe_login_buttons > button[type="submit"]'); + $btn.attr('disabled', 'disabled'); + $btn.prepend(' '); }); } });