_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)
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
# 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