From a6568a69db57eb0a57f2975c7ba74efabc83cd09 Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Fri, 28 Apr 2023 13:02:03 +0000 Subject: [PATCH] [FIX] mass_mailing: restore save on blur Commit [1] defined a value for the `onWysiwygBlur` option of `Wysiwyg` in the `mass_mailing` `html field`. This had the side effect of overriding the value set by its parent `html field`, which was to call `commitChanges`. As a result, the `mass_mailing` `html field` was not saving its content on blur. This restores that behavior by explicitly adding the call to `commitChanges` where it was missing. [1]: https://github.com/odoo/odoo/commit/e212e873eb35eb9b9a931fb1521109475c008074 task-3288881 closes odoo/odoo#121231 X-original-commit: 817d494e4eaa29983f75d4f3d6754ef3c3cc6e51 Signed-off-by: David Monjoie (dmo) Signed-off-by: Antoine Guenet (age) --- addons/mass_mailing/static/src/js/mass_mailing_html_field.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/mass_mailing/static/src/js/mass_mailing_html_field.js b/addons/mass_mailing/static/src/js/mass_mailing_html_field.js index 46e4892b354..99e34e15165 100644 --- a/addons/mass_mailing/static/src/js/mass_mailing_html_field.js +++ b/addons/mass_mailing/static/src/js/mass_mailing_html_field.js @@ -50,7 +50,10 @@ export class MassMailingHtmlField extends HtmlField { resizable: false, defaultDataForLinkTools: { isNewWindow: true }, toolbarTemplate: 'mass_mailing.web_editor_toolbar', - onWysiwygBlur: () => this.wysiwyg.odooEditor.toolbarHide(), + onWysiwygBlur: () => { + this.commitChanges(); + this.wysiwyg.odooEditor.toolbarHide(); + }, ...this.props.wysiwygOptions, }; }