From 18854caedd54e8e4c798c79c70eb6d562ca32932 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Tue, 1 Oct 2019 11:49:53 +0000 Subject: [PATCH] [FIX] website_event: prevent crash if clicking on register too soon Since https://github.com/odoo/odoo/commit/02dab5dc88112fd5f5ee43882ca022529acb4abf, the JS is now lazy loaded. As the "Register Now" button on each event page relies on JavaScript to perform a RPC, it needs the JS to be loaded to be able to work properly when clicking on it. In this case, clicking on it while the JS is not loaded yet performs a standard form submit, which lands on a route which cannot handle a standard form submit which then results in a 400 error page. This commit fixes the problem by adding the 'o_wait_lazy_js' class on the button which simply prevents click on elements during lazy loading. Discovered while working on task-2043872 closes odoo/odoo#37675 X-original-commit: https://github.com/odoo/odoo/commit/5e885436f9a77b4c387cd0b1eb07102ff85bec03 Signed-off-by: Quentin Smetz (qsm) --- addons/website_event/views/event_templates.xml | 2 +- addons/website_event_sale/views/event_templates.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_event/views/event_templates.xml b/addons/website_event/views/event_templates.xml index f33f64c4f61..ad5b83b72f7 100644 --- a/addons/website_event/views/event_templates.xml +++ b/addons/website_event/views/event_templates.xml @@ -580,7 +580,7 @@
- +
diff --git a/addons/website_event_sale/views/event_templates.xml b/addons/website_event_sale/views/event_templates.xml index 12a42ad99ed..117a1f02246 100644 --- a/addons/website_event_sale/views/event_templates.xml +++ b/addons/website_event_sale/views/event_templates.xml @@ -70,7 +70,7 @@
- +