From 30aa75329c7254daaf8b89b5e468629b74731e49 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 23 Mar 2018 11:55:31 +0000 Subject: [PATCH] [FIX] website_form: Disable form send on editable mode Before this patch, when a user was editing a website page containing a form and he clicked "Send", for some reason, the form tried to be sent. Now, the button behavior is disabled when entering editable mode. Closes #23852 --- addons/website_form/static/src/js/website_form.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/website_form/static/src/js/website_form.js b/addons/website_form/static/src/js/website_form.js index 2f91db94c9b..022156b99f7 100644 --- a/addons/website_form/static/src/js/website_form.js +++ b/addons/website_form/static/src/js/website_form.js @@ -13,7 +13,11 @@ odoo.define('website_form.animation', function (require) { snippet_animation.registry.form_builder_send = snippet_animation.Class.extend({ selector: '.s_website_form', - start: function() { + start: function(editable_mode) { + if (editable_mode) { + this.stop(); + return; + } var self = this; this.templates_loaded = ajax.loadXML('/website_form/static/src/xml/website_form.xml', qweb); this.$target.find('.o_website_form_send').on('click',function(e) {self.send(e);});