menuitemodoo-8odoo

How to find the id of the menu elements in Odoo?


When I activate developer mode, I'm unable to locate the menu ID that I can use as a parent in a new menu item tag. Is there a specific location within the configuration where I can find it?


Solution

  • There are two ways of declaring a menuitem:

    <menuitem id="menu_human_readable_name" 
              name="Human readable name" 
              parent="base.menu_custom" 
              sequence="10" 
              action="action_name" />
    
    <record id="menu_human_readable_name" model="ir.ui.menu" >
        <field name="name">Human readable name</field>
        <field name="sequence" eval="10" />
        <field name="action" ref="action_name" />
        <field name="parent_id" ref="base.menu_custom" />
    </record>
    

    There is another option: you can go to the table where you can see or search the string of the menuitem in the interface: Settings > Technical > User Interface > Menu items

    Maybe there are any other way to search them, but I am unaware of it.

    I hope this helps you