Tuesday, 12 July 2016

Odoo Menu : Hiding ,Deleting, replacing name or showing the menu only in debug mode


To delete the menu
<delete model="ir.ui.menu" id="mail.menu_contacts"/>

To replace name of menu id
<record model="ir.ui.menu" id="hr.menu_hr_root">
<field name="name">HR</field>      
</record>

To show the menu only in debug mode by using 'base.group_no_one' 
<record model="ir.ui.menu" id="hr.menu_hr_root">
<field name="name">Employees</field>
<field eval="[(6,0,[ref('base.group_no_one')])]" name="groups_id"/>
</record>
Note : 
  eval="[(6,0,[ref('base.group_no_one')])]"

It will replace all existing group ids with 'base.group_no_one' id in applied in 'hr.menu_hr_root' menu id .

<record model="ir.ui.menu" id="hr.menu_hr_root">
<field name="groups_id" eval="[(4,ref('base.group_no_one'))]"/>
</record>
   eval="[(4,ref('base.group_no_one'))]"
It will update given group id with existing group ids applied in 'hr.menu_hr_root' menu.



No comments:

Post a Comment