From 0f37addf6112f68f1350d4152d2142a2c70ef9a0 Mon Sep 17 00:00:00 2001 From: Nicolas Bayet Date: Mon, 28 Mar 2022 14:02:40 +0000 Subject: [PATCH] [FIX] web_editor: prevent powerbox step from staying in history Before this commit Calling a command of the powerbox created a step that delete the input content of the powerbox. That input content came back upon undo. After this commit The input content that select a command from the powerbox should never come back upon undo. task-2806849 closes odoo/odoo#87994 X-original-commit: 2da3d928ad4c7e7c285b753fb1241326089d45e7 Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js b/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js index 7713778772e..b88b95654b9 100644 --- a/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js +++ b/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js @@ -1845,6 +1845,7 @@ export class OdooEditor extends EventTarget { preValidate: () => { this._historyRevertUntil(this._beforeCommandbarStepIndex); this.historyStep(true); + this._historyStepsStates.set(peek(this._historySteps).id, 'consumed'); setTimeout(() => { this.editable.focus(); getDeepRange(this.editable, { select: true });