1 # -*- coding: utf-8 -*-
2 ##############################################################################
4 # OpenERP, Open Source Management Solution
5 # Copyright (C) 2010 OpenERP s.a. (<http://openerp.com>).
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as
9 # published by the Free Software Foundation, either version 3 of the
10 # License, or (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 ##############################################################################
22 from openerp.controllers import SecuredController
23 from openobject import rpc
24 from openobject.tools import expose
27 class Root(SecuredController):
31 @expose(mark_only=True)
32 def menu(self, active=None, next=None):
35 except (TypeError, ValueError):
38 menus = rpc.RPCProxy("ir.ui.menu")
39 ids = menus.search([('parent_id', '=', False)])
41 if not menu_id and ids:
46 ctx = dict(lang='NO_LANG') # force loading original string even if the english have been translated...
47 menu = menus.read([menu_id], ['name'], ctx)[0]['name'] or ''
52 'administration': 87935,
53 'human resources': 87923,
55 'manufacturing': 87915,
57 'point of sale': 87929,
63 }.get(menu.lower().strip(), general_forum)
65 cherrypy.request.uservoice_forum = forum
66 return super(Root, self).menu(active, next)