Menu items

Menu items are stored in the ir.ui.menu model and can be browsed via the Settings | Technical | User Interface | Menu Items menu.

The todo_app addon created a top-level menu to open the To-Do Tasks. Now we want to modify it to a second-level menu and have other menu options alongside it.

To do this, we will modify the existing To-Do Task menu option, to remove the corresponding action and make it a parent menu item. Edit the views/todo_menu.xml  to add:

<!-- Menu items -->
<!-- Overwrite the top menu item to remove Action -->
<menuitem id="todo_app.menu_todo_task"    name="To-Do"    action="" />

We used the more convenient <menuitem> shortcut element, instead of a <record model="ir.ui.menu"> element, which provides an abbreviated way ...

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.