From f3d840d1a674305f5171d015e7df3193f37cfb13 Mon Sep 17 00:00:00 2001 From: "Arthur Detroux (ard)" Date: Fri, 14 May 2021 08:50:30 +0000 Subject: [PATCH] [FIX] mass_mailing: make editor perform cleanForSave on save Before this commit, when editing a mass_mailing template, on save, the editor would not tell the snippet menu to perform a cleanForSave which it should normally do for the option to properly prepare to save. Bug discovered while working on task-2327045 Ideally, would need to be backported but requires a different fix in the old editor. closes odoo/odoo#72346 X-original-commit: 639b6a55586107bd3d855d322c1102df101eb079 Signed-off-by: Quentin Smetz (qsm) --- addons/mass_mailing/static/src/js/mass_mailing_widget.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/mass_mailing/static/src/js/mass_mailing_widget.js b/addons/mass_mailing/static/src/js/mass_mailing_widget.js index 951571f5e6f..fa760a51d97 100644 --- a/addons/mass_mailing/static/src/js/mass_mailing_widget.js +++ b/addons/mass_mailing/static/src/js/mass_mailing_widget.js @@ -48,7 +48,7 @@ var MassMailingFieldHtml = FieldHtml.extend({ * * @override */ - commitChanges: function () { + commitChanges: async function () { var self = this; if (this.mode === 'readonly' || !this.isRendered) { return this._super(); @@ -60,7 +60,9 @@ var MassMailingFieldHtml = FieldHtml.extend({ } var $editable = this.wysiwyg.getEditable(); - + if (this.wysiwyg.snippetsMenu) { + await this.wysiwyg.snippetsMenu.cleanForSave(); + } return this.wysiwyg.saveModifiedImages(this.$content).then(function () { self._isDirty = self.wysiwyg.isDirty();