[MERGE][REM] Configurable menu action for users -- was broken (web part)
bzr revid: rim@openerp.com-20140429143923-1340bi40th1w57du
This commit is contained in:
commit
adef80714d
|
@ -1088,16 +1088,7 @@ class Menu(http.Controller):
|
|||
"""
|
||||
s = request.session
|
||||
Menus = s.model('ir.ui.menu')
|
||||
# If a menu action is defined use its domain to get the root menu items
|
||||
user_menu_id = s.model('res.users').read([s.uid], ['menu_id'],
|
||||
request.context)[0]['menu_id']
|
||||
|
||||
menu_domain = [('parent_id', '=', False)]
|
||||
if user_menu_id:
|
||||
domain_string = s.model('ir.actions.act_window').read(
|
||||
[user_menu_id[0]], ['domain'],request.context)[0]['domain']
|
||||
if domain_string:
|
||||
menu_domain = ast.literal_eval(domain_string)
|
||||
|
||||
return Menus.search(menu_domain, 0, False, False, request.context)
|
||||
|
||||
|
|
|
@ -28,9 +28,7 @@ class LoadTest(common.MockRequestCase):
|
|||
|
||||
self.MockMenus = model('ir.ui.menu')
|
||||
# Mock the absence of custom menu
|
||||
model('res.users').read.return_value = [{
|
||||
'menu_id': False
|
||||
}]
|
||||
model('res.users').read.return_value = []
|
||||
|
||||
def tearDown(self):
|
||||
del self.MockMenus
|
||||
|
|
Loading…
Reference in New Issue