From 78a6124d5ab4eb0b44fdcbd455d9f322d18b8a70 Mon Sep 17 00:00:00 2001 From: Priyanka Kakadiya Date: Tue, 3 Jul 2018 12:28:13 +0530 Subject: [PATCH] [FIX] web: no traceback on button call action of type `'button'`. Before this commit, there was a traceback when clicking on a button that generates a button call action with type `'button'`. This is due to the handler of such an action that assumes only a small set of button actions. Each of those cases correctly sets the local variable `def` to a deferred, so that the post-processing is correct (i.e. it handles this variable as a deferred). However, this is wrong with a different button call action, so that this variable is `undefined` instead of a deferred. This commit fixes the issue by ensuring that the variable `def` is always a deferred. As a result, the post-processing can make the correct assumption that this variable is a deferred. Steps to reproduce: - Install Google Drive Integration app - Go to General Settings - In the category "Google Drive", click on "Get Authorization Code" (displayed as "Get Author...") Task-ID 1861630 --- addons/web/static/src/js/chrome/action_manager_act_window.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/chrome/action_manager_act_window.js b/addons/web/static/src/js/chrome/action_manager_act_window.js index 39277248480..9a9ed62e6be 100644 --- a/addons/web/static/src/js/chrome/action_manager_act_window.js +++ b/addons/web/static/src/js/chrome/action_manager_act_window.js @@ -663,7 +663,7 @@ ActionManager.include({ var env = ev.data.env; var context = new Context(env.context, actionData.context || {}); var recordID = env.currentID || null; // pyeval handles null value, not undefined - var def; + var def = $.Deferred(); // determine the action to execute according to the actionData if (actionData.special) {