[FIX] website_mass_mailing: fix traceback when saving with popup open

When the newsletter popup was introduced, the modal was for some reason
marked with the o_editable class, which is normally used to let the
editor know which elements in the page can be edited and saved in the
database. Because of this, upon saving with the modal in the page (ie,
if the modal is open when saving) it would try to destroy the editor
associated with the modal, which doesn't exist, resulting in a
traceback.

This commit fixes that by removing the o_editable class from the modal,
this doesn't actually prevent edition, because the modal is already
inside of an editable segment of the page.

task-2092593

closes odoo/odoo#50080

X-original-commit: 856d21cef530a9393bcebbf314a9316934ffb7c7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
Samuel Degueldre
2020-04-23 13:11:06 +00:00
parent 7be90d25e6
commit 91c3b1c0d7
@@ -167,7 +167,7 @@ publicWidget.registry.newsletter_popup = publicWidget.Widget.extend({
$content: $('<div/>').html(content),
$parentNode: this.$target,
backdrop: !this.editableMode,
dialogClass: 'p-0' + (this.editableMode ? ' o_editable oe_structure oe_empty' : ''),
dialogClass: 'p-0' + (this.editableMode ? ' oe_structure oe_empty' : ''),
renderFooter: false,
size: 'medium',
});