[MERGE][REM] Configurable menu action for users -- was broken (server part)

This commit requires r3995 of web branch

bzr revid: rim@openerp.com-20140429144026-4zgv8ahb5er3rl83
This commit is contained in:
Randhir Mayatra (OpenERP) 2014-04-29 16:40:26 +02:00 committed by Richard Mathot (OpenERP)
commit 27bd093089
3 changed files with 1 additions and 24 deletions

View File

@ -11,15 +11,6 @@
</field>
<field name="field_parent">child_id</field>
</record>
<record id="action_menu_admin" model="ir.actions.act_window">
<field name="name">Menu</field>
<field name="usage">menu</field>
<field name="type">ir.actions.act_window</field>
<field name="view_id" ref="view_menu"/>
<field name="res_model">ir.ui.menu</field>
<field name="view_type">tree</field>
<field name="domain">[('parent_id', '=', False)]</field>
</record>
<record id="lang_en" model="res.lang">
<field name="code">en_US</field>
@ -75,7 +66,6 @@
<field name="partner_id" ref="base.partner_root"/>
<field name="company_id" ref="main_company"/>
<field name="company_ids" eval="[(4, ref('main_company'))]"/>
<field name="menu_id" ref="action_menu_admin"/>
<field name="signature">--
Administrator</field>
</record>

View File

@ -154,8 +154,7 @@ class res_users(osv.osv):
"a change of password, the user has to login again."),
'signature': fields.text('Signature'),
'active': fields.boolean('Active'),
'action_id': fields.many2one('ir.actions.actions', 'Home Action', help="If specified, this action will be opened at logon for this user, in addition to the standard menu."),
'menu_id': fields.many2one('ir.actions.actions', 'Menu Action', help="If specified, the action will replace the standard menu for this user."),
'action_id': fields.many2one('ir.actions.actions', 'Home Action', help="If specified, this action will be opened at log on for this user, in addition to the standard menu."),
'groups_id': fields.many2many('res.groups', 'res_groups_users_rel', 'uid', 'gid', 'Groups'),
# Special behavior for this field: res.company.search() will only return the companies
# available to the current user (should be the user's companies?), when the user_preference
@ -217,16 +216,6 @@ class res_users(osv.osv):
return [c]
return False
def _get_menu(self,cr, uid, context=None):
dataobj = self.pool.get('ir.model.data')
try:
model, res_id = dataobj.get_object_reference(cr, uid, 'base', 'action_menu_admin')
if model != 'ir.actions.act_window':
return False
return res_id
except ValueError:
return False
def _get_group(self,cr, uid, context=None):
dataobj = self.pool.get('ir.model.data')
result = []
@ -244,7 +233,6 @@ class res_users(osv.osv):
'password': '',
'active': True,
'customer': False,
'menu_id': _get_menu,
'company_id': _get_company,
'company_ids': _get_companies,
'groups_id': _get_group,

View File

@ -201,7 +201,6 @@
</group>
<group string="Menus Customization" groups="base.group_no_one">
<field name="action_id"/>
<field domain="[('usage','=','menu')]" name="menu_id" required="True"/>
</group>
</group>
<group string="Messaging and Social" name="messaging">