[FIX] web_editor: apply changes on exit code view

When leaving the code view, we need to apply its html to the editable.
This failed in mass_mailing because the editor rolled back the changes
due to the top element being unremovable. To avoid that, we set the
`skipRollback` argument of `historyStep` to `true` and thereby trust the
user's changes.

task-2701024

closes odoo/odoo#80522

X-original-commit: 17f0ca0d6b7a583192caa33bb9d3e35c72256d4e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
This commit is contained in:
Antoine Guenet
2021-11-29 13:09:51 +00:00
parent 88b4431c1c
commit 5d184c5fd8
@@ -228,7 +228,7 @@ var FieldHtml = basic_fields.DebouncedField.extend(TranslatableFieldMixin, {
}
this.wysiwyg.odooEditor.observerActive();
this.wysiwyg.setValue($codeview.val());
this.wysiwyg.odooEditor.historyStep();
this.wysiwyg.odooEditor.historyStep(true);
} else {
this.resizerHandleObserver = new MutationObserver((mutations, observer) => {
for (let mutation of mutations) {