[FIX] mass_mailing: fix content not saved

Issue

	- Install Email Marketing
	- Create/Edit one of them
	- Save

	Changes not saved

	- Click edit & save

	Changes saved

Cause

	Before 30db768, the order of execution was:

	1. field_html > commitChanges (value = <p><br></p>)
	2. mass_mailing_widget > commitChanges (value = "test")

	After 30db768:

	1. mass_mailing_widget > commitChanges (value = "test")
	2. field_html > commitChanges (value = <p><br></p>)

Solution

	Use this.saveCroppedImages in mass_mailing widget to
	add the delay there too

OPW-2207107
OPW-2207817

closes odoo/odoo#47018

X-original-commit: 31e36fdc9b63fade99cef0c9ac4ed093b3936707
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
This commit is contained in:
jvm-odoo
2020-03-05 16:05:56 +00:00
parent 917e7a1a9b
commit 0e3b5c265b
@@ -58,21 +58,23 @@ var MassMailingFieldHtml = FieldHtml.extend({
var $editable = this.wysiwyg.getEditable();
return this.wysiwyg.save().then(function (result) {
self._isDirty = result.isDirty;
return this.wysiwyg.saveCroppedImages(this.$content).then(function () {
return self.wysiwyg.save().then(function (result) {
self._isDirty = result.isDirty;
convertInline.attachmentThumbnailToLinkImg($editable);
convertInline.fontToImg($editable);
convertInline.classToStyle($editable);
convertInline.attachmentThumbnailToLinkImg($editable);
convertInline.fontToImg($editable);
convertInline.classToStyle($editable);
self.trigger_up('field_changed', {
dataPointID: self.dataPointID,
changes: _.object([fieldName], [self._unWrap($editable.html())])
self.trigger_up('field_changed', {
dataPointID: self.dataPointID,
changes: _.object([fieldName], [self._unWrap($editable.html())])
});
if (self._isDirty && self.mode === 'edit') {
return self._doAction();
}
});
if (self._isDirty && self.mode === 'edit') {
return self._doAction();
}
});
},
/**