Odoo Help


How to inherit or override a menu item

on 11/10/14, 8:01 PM 12,311 views


   I created a custom hr module and was wondering how I can modify the groups attribute for the top Human Resources menu item.  What I would like to do is remove one of the groups on the original menu item so that users in that group cant see it.  Is there a way to inherit the original menu item in my custom hr module, and use xpath to modify it? Or is there another (easier) way to do it?

Marvin Taboada
On 11/10/14, 11:24 PM

Hello Eric, menu entries are usually defined with the 'menuitem' XML tag (e.g. for Project>Configuration see this link):

<menuitem name="menuName" id="mod_id.menu_id" ... />

At installing the module, however, they are stored as records of the 'ir.ui.menu' object type. where the many2many relationship to 'res.groups' is defined.

Given that, it is perfectly possible to use 'record' XML tags to update 'ir.ui.menu' records by providing 'model' and 'id' attributes to identify the existing record. E.g. Project>Configuration (source here):

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

Just remember 'groups_id' is a many2many relationship, so you will require to provide an appropriate tuple to update the relationship (the above example replaces all groups). Look for the documentation of 'write(vals)' here for a reference.



This is a very simple solution. Thank you!

on 11/11/14, 11:20 AM

I didn't quite understand that. Let's say I would like to add a sub-menu to Sales/Sales, what I did was to write the following code in my custom module:

<menuitem name="Daily Transports" id="daily_transports_menu" sequence="10" parent="base.menu_base_partner" action="daily_transports_action"/>

but I didn't get it to appear under the sales submenus

Demian Rihs
on 1/10/17, 7:22 PM

Baiju KS

--Baiju KS--
| 5 5 8
Kochi, India
--Baiju KS--
ODOO technical

        I like learning new thing, especially technical thing. I am a quick learner, I can learn technical things very fast. I have good logical skill,  I have immense interest in programming.

e-mail id : baijuks@hotmail.com

Baiju KS
On 11/10/14, 11:18 PM

To redefine menu item you don't need xpath ,, simply redfine that in your xml file,, with correct id reference ,, here change  id as " hr.menu_hr_root"


<menuitem name="Human Resources"

you can evict group from Human Resources menuitem like this:-

<menuitem name="Human Resources"


About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 11/10/14, 8:01 PM
Seen: 12311 times
Last updated: 2/8/18, 10:48 PM