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

bzr revid: odo@openerp.com-20130506133915-punpieubdyu1nxgl
This commit is contained in:
Olivier Dony
2013-05-06 15:39:15 +02:00
parent a7a4f33d0f
commit aa68659e47
+4 -1
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 () {