diff --git a/addons/web_editor/static/lib/odoo-editor/src/powerbox/Powerbox.js b/addons/web_editor/static/lib/odoo-editor/src/powerbox/Powerbox.js index a8523dc73e1..2df4c28e1ae 100644 --- a/addons/web_editor/static/lib/odoo-editor/src/powerbox/Powerbox.js +++ b/addons/web_editor/static/lib/odoo-editor/src/powerbox/Powerbox.js @@ -131,7 +131,7 @@ export class Powerbox { ev => { ev.preventDefault(); ev.stopImmediatePropagation(); - this._currentValidate(); + this._currentValidate(command); }, true, ); @@ -254,10 +254,12 @@ export class Powerbox { this.options.onStop && this.options.onStop(); }; - this._currentValidate = async () => { - const command = this._currentFilteredCommands.find( - c => c === this._currentSelectedCommand, - ); + this._currentValidate = async (command) => { + if (!command) { + command = this._currentFilteredCommands.find( + c => c === this._currentSelectedCommand, + ); + } if (command) { !command.isIntermediateStep && (!command.shouldPreValidate || command.shouldPreValidate()) &&