[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) <dmo@odoo.com>
This commit is contained in:
Nicolas Bayet
2023-02-27 12:54:48 +01:00
parent 2810aa3422
commit d7ea3c1aec
@@ -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) === "<p><br></p>") && value !== lastValue) {
if (
value !== null &&
!(!lastValue && stripHistoryIds(value) === "<p><br></p>") &&
stripHistoryIds(value) !== stripHistoryIds(lastValue)
) {
this.props.setDirty(false);
this.currentEditingValue = value;
await this.props.record.update({ [this.props.name]: value });