From b5065e9fe42e4d6239b8bedc8e14dc0bd5b0e7a7 Mon Sep 17 00:00:00 2001 From: "Maruan Aguerdouh (magm)" Date: Wed, 14 Feb 2024 01:16:57 +0100 Subject: [PATCH] [FIX] web_editor: no premature saving of article Issue: Articles were erroneously marked as changed, leading to unnecessary autosaves. Part of this was caused by the inclusion of history IDs in the content comparison process, which differ even without substantive content changes. Solution: Applied `stripHistoryIds` to the content obtained from the WYSIWYG editor before performing the dirty check. This ensures that comparisons focus solely on actual content changes, eliminating history IDs as a factor in the dirty state determination. opw-3707380 closes odoo/odoo#154068 Related: odoo/enterprise#56626 Signed-off-by: Nicolas Bayet (nby) --- addons/web_editor/static/src/js/backend/html_field.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/backend/html_field.js b/addons/web_editor/static/src/js/backend/html_field.js index d13a90d5e8f..fa3ca9c2add 100644 --- a/addons/web_editor/static/src/js/backend/html_field.js +++ b/addons/web_editor/static/src/js/backend/html_field.js @@ -441,7 +441,7 @@ export class HtmlField extends Component { div.style.display = 'none'; div.append(editable); document.body.append(div); - const editableValue = this.wysiwyg.getValue({ $layout: $(editable) }); + const editableValue = stripHistoryIds(this.wysiwyg.getValue({ $layout: $(editable) })); div.remove(); parsedPreviousValue = domParser.parseFromString(editableValue, 'text/html').body; } else {