Odoo - OpenERP - How to create a new menu item and place it under other module's menu?

Support
Support
5000
| 2 1 2
Asked on 7/8/15, 6:34 PM
0
vote
8654 Views

To place a Menu under Other Module menus you need to include the Parent module in your __openerp__.py file and give the parent menu id in your menu item. Consider a model called Test.

To make that Module visible under Human Resources module do the following steps:

Step-1: in __openerp__.py add the following line "depends" : ["hr"],

Step-2: then in your view xml file add the following lines

Line-1: <menuitem id="menu_test" parent="hr.menu_hr_root" name="Test Module Parent"/>

Line-2: <menuitem id="menu_test_child" parent="menu_test" name="My Menu" action="action_test"/>

 

Here **parent="hr.menu_hr_root"** denotes the parent id under which you are going to place your menu. i.e., hr.menu_hr_root is the id of the Human Resource menu. And **name="Test Module Parent"** denotes your Test menu's parent name and it can be anything. The Line-2 denotes your clickable menu. Here the **action="action_test"** denotes the action to be carried out when you click on My Menu.

 

Menu Attribute

  1. name=name of your menu

  2. id=unique id for each menu item

  3. string = Name of your sting which you want display in your view form not string attribute is not define then the menu string automatically set as your menu action name
  4. action=name of your action which you want to call
  5. parent=your_dependent_module_name.parent menu id in your child menu if your parent menu is in your same module then the dependent module name is not needed to add in your parent attribute
  6. sequence =Define the sequence for the menu displaying in your view
Support
Support
5000
| 2 1 2
Answered on 7/8/15, 6:38 PM
0
vote

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This forum is for HiTechnologia Employees & just Odoo general knowledge purpose only.

Read Guidelines

Question tools

3 follower(s)

Stats

Asked: 7/8/15, 6:34 PM
Seen: 8654 times
Last updated: 7/8/15, 6:38 PM