Menu items

Menu items are stored in the ir.ui.menu model, and can be searched for in the Settings menu by navigating to Technical | User Interface | Menu Items. If we search for Messaging, we will see that it has Organizer as one of its submenus. With the help of the developer tools we can find the XML ID for that menu item: it is mail.mail_my_stuff.

We will replace the existing To-do Task menu item with a submenu that can be found by navigating to Messaging | Organizer. In the todo_view.xml, after the window actions, add this code:

    <menuitem id="menu_todo_task_main" name="To-Do" parent="mail.mail_my_stuff" /> <menuitem id="todo_app.menu_todo_task" name="To-Do Tasks" parent="menu_todo_task_main" sequence="10" action="todo_app.action_todo_task" /> <menuitem id="menu_todo_task_stage" name="To-Do Stages" parent="menu_todo_task_main" sequence="20" action="action_todo_stage" />

The menu option data for the ir.ui.menu model can also be loaded using the <menuitem> shortcut element, as used in the preceding code.

The first menu item, To-Do, is a child of the mail.mail_my_stuff Organizer menu option. It has no action assigned, since it will be used as a parent for the next two options.

The second menu option rewrites the option defined in the todo_app module so that it is relocated under the To-Do main menu item.

The third menu item adds a new option to access the to-do stages. We will need it in order to add some data to be able to use stages in to-do tasks.

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

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