diff --git a/addons/website_event/static/src/js/website_event.js b/addons/website_event/static/src/js/website_event.js index 36c0f5df526..527d954c524 100644 --- a/addons/website_event/static/src/js/website_event.js +++ b/addons/website_event/static/src/js/website_event.js @@ -77,8 +77,16 @@ publicWidget.registry.EventRegistrationFormInstance = publicWidget.Widget.extend */ start: function () { var def = this._super.apply(this, arguments); - var instance = new EventRegistrationForm(this); - return Promise.all([def, instance.attachTo(this.$el)]); + this.instance = new EventRegistrationForm(this); + return Promise.all([def, this.instance.attachTo(this.$el)]); + }, + /** + * @override + */ + destroy: function () { + this.instance.setElement(null); + this._super.apply(this, arguments); + this.instance.setElement(this.$el); }, });