[MERGE] [FIX] mail: locate current menu using a safer method + check case

bzr revid: tde@openerp.com-20130506153023-8o1fl4jhunf3ks1p
This commit is contained in:
Thibault Delavallée 2013-05-06 17:30:23 +02:00
commit 5c3972fd02
1 changed files with 4 additions and 1 deletions

View File

@ -1709,7 +1709,10 @@ openerp.mail = function (session) {
* contain the menu widget and the the sub menu related of this wall
*/
do_reload_menu_emails: function () {
var menu = this.getParent().getParent().__parentedParent.menu || this.getParent().getParent().getParent().getParent().__parentedParent.menu;
var menu = session.webclient.menu;
if (!menu) {
return $.when();
}
return menu.rpc("/web/menu/load_needaction", {'menu_ids': [menu.current_menu]}).done(function(r) {
menu.on_needaction_loaded(r);
}).then(function () {