[FIX] supposed problem in menu when a client action fails

bzr revid: nicolas.vanhoren@openerp.com-20121217150005-xucbt5xvysl85768
This commit is contained in:
niv-openerp
2012-12-17 16:00:05 +01:00
parent 5ab570b5ea
commit af3dbd598d
+10 -1
View File
@@ -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;
});
});
},