How to add a new menu item to an existing odoo module?

I want to add a new menu item to the human resources module.

I am creating a new module, depends on the "hr" module.

and i am creating xml file to add new menu and field.

this my code:

<menuitem id="menu_new" parent="menu_hr_root" name="new" sequence="30"/>

      

I am updating the list of modules and I reload the page, but I have not found the new menu.

thank you for your help.

+3


source to share


1 answer


We just need to add a parent id based on your dependent module name and then after your dependent menu id in the parent attribute

Some people think like this:

<menuitem name="Performance Appraisal" parent="your_module_name.menu_eval_hr" id="menu_open_per_appri_req"
        action="action_menu_perf_app_rel"/>

      



Menu Attribute

  • name = your menu name

  • id = unique identifier for each menu item

  • string = the name of your line that you want to display in the view form no string attribute is not defined, then the menu bar is automatically specified as your menu name
  • action = the name of your action you want to call
  • parent = your_dependent_module_name.parent id of the menu in your child menu if your parent menu is in the same module then the dependent module name is not required to be added to its parent attribute
  • sequence = Determine the sequence for displaying the menu in your view

I hope this is helpful to you .. :)

+4


source







All Articles