From d7ea3c1aec769931c41b48197935df8660d28004 Mon Sep 17 00:00:00 2001 From: Nicolas Bayet Date: Tue, 21 Feb 2023 10:49:03 +0000 Subject: [PATCH] [FIX] web_editor: test equality of stripped values in updateValue Since https://github.com/odoo/odoo/commit/1b8d663cdccced35fd294ef3481aa7ce294880f0, in `updateValue`, the `value` and `lastValue` could have different `data-last-history-steps` and still be the same value. This commit fixes the method to compare the values stripped of their history ids. opw-3134569 closes odoo/odoo#113726 X-original-commit: 5abb2ced63caffaf528f7b71eb1c193729ecd327 Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/src/js/backend/html_field.js | 6 +++++- 1 file changed, 5 insertions(+), 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 5df4741eb97..6b6d1226db0 100644 --- a/addons/web_editor/static/src/js/backend/html_field.js +++ b/addons/web_editor/static/src/js/backend/html_field.js @@ -289,7 +289,11 @@ export class HtmlField extends Component { async updateValue() { const value = this.getEditingValue(); const lastValue = (this.props.value || "").toString(); - if (value !== null && !(!lastValue && stripHistoryIds(value) === "


") && value !== lastValue) { + if ( + value !== null && + !(!lastValue && stripHistoryIds(value) === "


") && + stripHistoryIds(value) !== stripHistoryIds(lastValue) + ) { this.props.setDirty(false); this.currentEditingValue = value; await this.props.record.update({ [this.props.name]: value });