diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js index 115cba01261..f688230294f 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js @@ -964,9 +964,9 @@ export class OdooEditor extends EventTarget { } case 'childList': { record.addedNodes.forEach(added => { - this._toRollback = - this._toRollback || - (containsUnremovable(added) && UNREMOVABLE_ROLLBACK_CODE); + if (!this._toRollback && containsUnremovable(added)) { + this._toRollback = UNREMOVABLE_ROLLBACK_CODE; + } const mutation = { 'type': 'add', }; @@ -1486,8 +1486,9 @@ export class OdooEditor extends EventTarget { } } unbreakableStepUnactive() { - this._toRollback = - this._toRollback === UNBREAKABLE_ROLLBACK_CODE ? false : this._toRollback; + if (this._toRollback === UNBREAKABLE_ROLLBACK_CODE) { + this._toRollback = false; + } this._checkStepUnbreakable = false; } historyPauseSteps() {