[REV] Revision 3408 revid:al@openerp.com-20121114005029-41tkuo2g93vbnz60 does not...
authorFabien Meghazi <fme@openerp.com>
Wed, 14 Nov 2012 09:07:31 +0000 (10:07 +0100)
committerFabien Meghazi <fme@openerp.com>
Wed, 14 Nov 2012 09:07:31 +0000 (10:07 +0100)
bzr revid: fme@openerp.com-20121114090731-hrw2eh6b1and8soc

addons/web/controllers/main.py
addons/web/static/src/js/chrome.js

index 844ec5d..ffabe97 100644 (file)
@@ -1002,6 +1002,10 @@ class Menu(openerpweb.Controller):
     _cp_path = "/web/menu"
 
     @openerpweb.jsonrequest
+    def load(self, req):
+        return {'data': self.do_load(req)}
+
+    @openerpweb.jsonrequest
     def get_user_roots(self, req):
         return self.do_get_user_roots(req)
 
@@ -1027,8 +1031,7 @@ class Menu(openerpweb.Controller):
 
         return Menus.search(menu_domain, 0, False, False, context)
 
-    @openerpweb.jsonrequest
-    def load(self, req, menu_id=None):
+    def do_load(self, req):
         """ Loads all menu items (all applications and their sub-menus).
 
         :param req: A request object, with an OpenERP session attribute
@@ -1044,11 +1047,7 @@ class Menu(openerpweb.Controller):
 
         # menus are loaded fully unlike a regular tree view, cause there are a
         # limited number of items (752 when all 6.1 addons are installed)
-        if menu_id:
-            # for load only one sub menu
-            menu_ids = Menus.search([['id', 'child_of', menu_id]], 0, False, False, context)
-        else:
-            menu_ids = Menus.search([], 0, False, False, context)
+        menu_ids = Menus.search([], 0, False, False, context)
         menu_items = Menus.read(menu_ids, ['name', 'sequence', 'parent_id', 'action', 'needaction_enabled', 'needaction_counter'], context)
         # adds roots at the end of the sequence, so that they will overwrite
         # equivalent menu items from full menu read when put into id:item
index aa6a7c1..69dafa0 100644 (file)
@@ -716,8 +716,7 @@ instance.web.Menu =  instance.web.Widget.extend({
     },
     menu_loaded: function(data) {
         var self = this;
-        // TODO remove data.data
-        this.data = {"data": data};
+        this.data = data;
         this.renderElement();
         this.limit_entries();
         // Hide toplevel item if there is only one