How to do it...

In an XML data file of our addon module, perform the following steps:

  1. 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"
/>
  1. 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"
/>
  1. 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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.94.249