From 3e5cc15d16e7f0dd38e2bfc3edd2b4a241e0d5ac Mon Sep 17 00:00:00 2001 From: Romeo Fragomeli Date: Wed, 9 Oct 2019 09:18:11 +0000 Subject: [PATCH] [FIX] web: warn is show when a client action is a function Before this commit, if we use some client action like: reload, logout, ... in the console a warning is show, because the action are function and not AbstractAction. After this commit, if the client action is not an function and not a AbstractAction the warning is show. X-original-commit: 122b76594aeb2c5d923d13c040c2da2048133aac --- addons/web/static/src/js/chrome/action_manager.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/js/chrome/action_manager.js b/addons/web/static/src/js/chrome/action_manager.js index 746460bdc4f..d049abaa8ec 100644 --- a/addons/web/static/src/js/chrome/action_manager.js +++ b/addons/web/static/src/js/chrome/action_manager.js @@ -420,9 +420,6 @@ var ActionManager = Widget.extend({ console.error("Could not find client action " + action.tag, action); return Promise.reject(); } - if (!(ClientAction.prototype instanceof AbstractAction)) { - console.warn('The client action ' + action.tag + ' should be an instance of AbstractAction!'); - } if (!(ClientAction.prototype instanceof Widget)) { // the client action might be a function, which is executed and // whose returned value might be another action to execute @@ -432,6 +429,9 @@ var ActionManager = Widget.extend({ } return Promise.resolve(); } + if (!(ClientAction.prototype instanceof AbstractAction)) { + console.warn('The client action ' + action.tag + ' should be an instance of AbstractAction!'); + } var controllerID = _.uniqueId('controller_');