summaryrefslogtreecommitdiff
path: root/addons/mass_mailing/static/src
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2021-01-28 11:28:09 +0000
committerNicolas Lempereur <nle@odoo.com>2021-01-28 13:20:10 +0000
commit256487ae9bc3701fa7b8e48490ab7d162736acbf (patch)
tree75532671544885449a761fa58aa0170e7525f1ea /addons/mass_mailing/static/src
parentd66652b4aa514546356306e3eb48eaecaba07c33 (diff)
[FIX] mass_mailing: save error does not break inlining
Scenario: - create mass mailing with icons and without title - save and get error "The followign fields are invalid: Subject" - fill subject and save - edit => the icons have disappeared This is because mass mailing widget is using: - a "body_html" field that contains inlined html - a wysiwyg editor to edit field "body_arch" - a textarea containing "body_arch" value to be saved When we save this happens: 1. we save the current value of wysiwyg into textarea 2. wysiwyg content is inlined (eg. transforming font in image) 3. inlined wysiwyg content is set to "body_html" field 4. if there: - is no error while saving => body_html and body_arch are saved and will be used on next edition - if there is an error the fields are not saved, and we now have an inlined content on wysiwyg, so next time we save the "body_arch" is going to be inlined: => this for example breaking the icons on edition Issue discovered when fixing opw-2447756 closes #65208 closes odoo/odoo#65217 X-original-commit: 0f5f53837bc403960e307ab85e9fe68423c23f5f Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'addons/mass_mailing/static/src')
-rw-r--r--addons/mass_mailing/static/src/js/mass_mailing_widget.js1
1 files changed, 1 insertions, 0 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 6d10529e31a..b39cb91734f 100644
--- a/addons/mass_mailing/static/src/js/mass_mailing_widget.js
+++ b/addons/mass_mailing/static/src/js/mass_mailing_widget.js
@@ -86,6 +86,7 @@ var MassMailingFieldHtml = FieldHtml.extend({
dataPointID: self.dataPointID,
changes: _.object([fieldName], [self._unWrap($editable.html())])
});
+ self.wysiwyg.setValue(result.html);
if (self._isDirty && self.mode === 'edit') {
return self._doAction();