summaryrefslogtreecommitdiff
path: root/addons/website_event/views
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2019-10-01 11:49:53 +0000
committerqsm-odoo <qsm@odoo.com>2019-10-01 11:49:53 +0000
commit18854caedd54e8e4c798c79c70eb6d562ca32932 (patch)
tree664e0591e440012ae417f36f456e0f460aab4982 /addons/website_event/views
parent5f65f1e0c84178cd830abdba937fde7b83c70112 (diff)
[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) <qsm@odoo.com>
Diffstat (limited to 'addons/website_event/views')
-rw-r--r--addons/website_event/views/event_templates.xml2
1 files changed, 1 insertions, 1 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 @@
</div>
</div>
<div class="col-lg-4 pt-3 pt-lg-0 pl-2 pl-lg-0">
- <button type="submit" class="btn btn-primary btn-block a-submit" t-attf-id="#{event.id}">Register</button>
+ <button type="submit" class="btn btn-primary o_wait_lazy_js btn-block a-submit" t-attf-id="#{event.id}">Register</button>
</div>
</div>
<div t-if="description" class="row mx-0">