Skip to content
Snippets Groups Projects
Commit 14f55b8d authored by Jason Van Malder's avatar Jason Van Malder
Browse files

[FIX] mass_mailing: fix unsaved changes in source mode editor

Issue

    - Install Email Marketing
    - Create/Edit a template
    - Switch into source mode
    - Add things
    - Save

    Things not saved.

Cause

    The widget override his parent `commitChanges` and don't take
    source mode into account.

Solution

    Take source mode into account like:
    https://github.com/odoo/odoo/commit/e29c08969f6e7ad981e9b7b79027d84dc89fbca2#diff-59db103a74684967379b66a89695cfdeR102-R105



OPW-2151675

closes odoo/odoo#42072

Signed-off-by: default avatarJason Van Malder <jvm-odoo@users.noreply.github.com>
parent 0e5ca50d
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,10 @@ var MassMailingFieldHtml = FieldHtml.extend({
*/
commitChanges: function () {
var self = this;
if (config.isDebug() && this.mode === 'edit') {
var layoutInfo = $.summernote.core.dom.makeLayoutInfo(this.wysiwyg.$editor);
$.summernote.pluginEvents.codeview(undefined, undefined, layoutInfo, false);
}
if (this.mode === 'readonly' || !this.isRendered) {
return this._super();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment