Odoo Help

Welcome!

This community 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.

2

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

By
vivek
on 5/10/13, 8:17 AM 6,119 views

Hi,

Can anyone tell me how to create a new menu item and place it under other module's menu? If possible please provide me some example links.

3
Abul Hassan
On 8/28/13, 9:34 AM

Hi Vivek,

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. Let me explain you with an Example. 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.

Great Answer Thanks Aspirants

Mohammed Roshan
on 3/17/15, 11:04 AM
1

Priyesh Solanki (pso)

--Priyesh Solanki (pso)--
Tiny ERP Pvt Ltd
http://www.odoo.com
1110
| 2 2 4
--Priyesh Solanki (pso)--
Priyesh Solanki (pso)
On 5/10/13, 9:43 AM

You can create menuitem like this:

<menuitem id="menu_product" name="Products" parent="base.menu_base_partner" sequence="9"/>

In other module, you need to use module name where the first its been created before menu id like this:

<menuitem id="product.menu_product" name="Products" parent="base.menu_base_partner" sequence="9"/>

Here, I used product before taking it's reference, it means its created in product module and i want to use it in another module so you have to user module_name.MENU_ID.

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!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/10/13, 8:17 AM
Seen: 6119 times
Last updated: 11/17/15, 6:30 AM