In an XML data file of our addon module, perform the following steps:
- Define an action to be executed:
<act_window id="action_all_customers" name="All customers" res_model="res.partner" view_mode="list,form" domain="[('customer', '=', True)]" context="{'default_customer': True}" limit="80"
/>
- Create the menu structure:
<menuitem id="menu_custom_toplevel" name="My custom menu"
/> <menuitem id="menu_custom_left" parent="menu_custom_toplevel" name="This will appear in the left bar"
/>
- Refer to our action in the menu:
<menuitem id="menu_all_customers" parent="menu_custom_left" action="action_all_customers" sequence="10" groups=""
/>
If we now upgrade the module, we will see a top-level menu that opens a submenu in the left menu bar. Clicking on that menu item will open a list of all customers.