[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) <nby@odoo.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user