Adding menu items

Now that we have the places to store our data, we want to have them available on the user interface. The first thing to do should be to add the corresponding menu options.

Create the views/todo_menu.xml file to define a menu item and the action performed by it:

<?xml version="1.0"?> 
<odoo> 
  <!-- Action to open To-do Task list --> 
  <act_window id="action_todo_task" 
    name="To-do Task" 
    res_model="todo.task" 
    view_mode="tree,form"  /> 
  <!-- Menu item to open To-do Task list -->
  <menuitem id="menu_todo_task" 
    name="Todos" 
    action="action_todo_task"  /> 
</odoo> 

The user interface, including menu options and actions, is stored in database tables. The XML file is a data file used to load those definitions into the database when the addon ...

Get Odoo 11 Development Essentials - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.