Dealing with several views of the same type

The same Model can have several Views of the same type, by default the view with the lowest Priority value, but an Action can set a specific view to be used, through its XML ID. Using this, we can have two different menu items opening the same model but use different views. This is achieved using the  view_id attribute of the Window Action, with the XML ID of the view to use. For example, in the todo_app.action_todo_task Action, we could add to it the view_id="view_form_todo_task_ui" attribute.

To add a new View and have it as the new default we just have to set it with a lower Priority than the existing ones. Since the default value for the view priority is 16, any lower value would do, so a 15 ...

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.