From 5d184c5fd8b5b6df39b218069a9ebbc4af2feb2f Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Mon, 29 Nov 2021 09:42:01 +0000 Subject: [PATCH] [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) Signed-off-by: Antoine Guenet --- addons/web_editor/static/src/js/backend/field_html.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/backend/field_html.js b/addons/web_editor/static/src/js/backend/field_html.js index 5fbde02010f..d86022ec12e 100644 --- a/addons/web_editor/static/src/js/backend/field_html.js +++ b/addons/web_editor/static/src/js/backend/field_html.js @@ -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) {