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

add top menu item in custom module [Closed]

By
shafeequemonp
on 3/5/14, 7:33 AM 11,190 views

The Question has been closed

by
Ray Carnes
on 03/08/2014 20:39:36

I need to create a menu item on top just before the settings item.can anyone help me ...

2

René Schuster

--René Schuster--
1560
| 5 5 8
Weinheim, Germany
--René Schuster--

Challenge Everything!

René Schuster
On 3/5/14, 9:05 AM

Create a xml for your custom module.

<openerp>
    <data>
        <menuitem name="Your Menu Name" id="your_menu_id" sequence="450"/>
    </data>
</openerp>

Make sure the xml file is listed in your __openerp__.py file for your custom module.

A few notes:

  • The sequence gives the order for your menu items (low to high), 'Settings' menu got sequence 500, 'Reporting' menu got sequence 170
  • for submenues you can use the parent attribute inside the menu tag: e.g. parent="menu_hr_root". If you leave this attribute your menu item will be at the very top
  • to manage the visibility for your menu item, you can use the groups attribute inside the menu tag: e.g. groups="base.group_user".

EDIT:

A few more notes:

  • If you leave the groups attribute the menuitem will be visible to everyone
  • OpenERP seems to be 'smart'. A menu item will first become visible after it (or any sub menu) has an actual action to perform something
  • the menuitem tag for xml views is used to create all menues on any hierarchy level. The actual hierarchy is controlled by the parent attribute.

EDIT2:

Example for a menu hierarchy:

<openerp>
    <data>
        <menuitem name="Your Root Menu Name" id="your_root_menu_id" sequence="450"/>
        <menuitem name="Your Sub Menu Category Name" id="your_sub_menu_category_id" parent="your_root_menu_id" sequence="10"/>
        <menuitem name="Your Sub Menu Name" id="your_sub_menu_id" parent="your_sub_menu_category_id" sequence="5"/>
        <menuitem name="Another Sub Menu" id="another_menu_id" parent="your_sub_menu_category_id" sequence="10"/>
    </data>
</openerp>

I recommend assigning actions to the lowest menu level only. (I'm not sure whether you can add a fourth level)

thanks sir ...fixed it and now need to create sub menus in left side when i click my root menu item..how can i do it ..may u please help..

shafeequemonp
on 3/6/14, 6:31 AM

k..sir while i creating more sub menus on root menu its not appearing ..how should i give the sequence number..

shafeequemonp
on 3/6/14, 11:20 PM

its fixed..

shafeequemonp
on 3/7/14, 12:01 AM

About This Community

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

Question tools

1 follower(s)

Stats

Asked: 3/5/14, 7:33 AM
Seen: 11190 times
Last updated: 7/23/16, 12:17 PM