Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove or hide a menu item in Odoo

Tags:

xml

openerp

I have this menu item, and I want to hide or remove it.

enter image description here

like image 343
Shridhar Ivani Avatar asked Nov 28 '22 20:11

Shridhar Ivani


1 Answers

First create a dummy group with no users in it

<record id="make_invisible" model="res.groups">
    <field name="name">Invisible</field>
 </record>

Replace all users in the group. The eval statement here means, replace all ids in the groups_id field with the id for group make_invisible.

<record model="ir.ui.menu" id="module.menu_name">
    <field name="groups_id" eval="[(6,0,[ref('make_invisible')])]"/>
</record>

You can find more information on how the eval works here

like image 134
BBBagadiya Avatar answered Jan 02 '23 16:01

BBBagadiya