Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
4 Відповіді
33143 Переглядів

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.

Аватар
Відмінити
Найкраща відповідь

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

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

<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

Найкраща відповідь

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.

Аватар
Відмінити
Найкраща відповідь

?


Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
груд. 24
829
1
квіт. 17
3552
2
січ. 24
13503
2
бер. 15
6912
2
серп. 24
1033