[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) <qsm@odoo.com>
This commit is contained in:
Arthur Detroux (ard)
2021-06-18 12:08:45 +00:00
committed by qsm-odoo
parent 54e06aa28d
commit f3d840d1a6
@@ -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();