From af3dbd598d60a470be54d6f34ba8cb0714238609 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 17 Dec 2012 16:00:05 +0100 Subject: [PATCH] [FIX] supposed problem in menu when a client action fails bzr revid: nicolas.vanhoren@openerp.com-20121217150005-xucbt5xvysl85768 --- addons/web/static/src/js/chrome.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 6101a712458..9e5a5936089 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1301,12 +1301,21 @@ instance.web.WebClient = instance.web.Client.extend({ result.context, {search_default_message_unread: true}); } - return $.when(self.action_manager.do_action(result, { + var completed = $.Deferred(); + $.when(self.action_manager.do_action(result, { clear_breadcrumbs: true, action_menu_id: self.menu.current_menu, })).fail(function() { self.menu.open_menu(options.previous_menu_id); + }).always(function() { + completed.resolve(); }); + setTimeout(function() { + completed.resolve(); + }, 2000); + // We block the menu when clicking on an element until the action has correctly finished + // loading. If something crash, there is a 2 seconds timeout before it's unblocked. + return completed; }); }); },