O'Reilly logo

Odoo Development Cookbook by Daniel Reis, Alexandre Fayolle, Holger Brunn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding Menu Items and Views

Once we have Models for our data structure needs, we want a user interface for our users to interact with them. This recipe builds on the Library Book Model from the previous recipe and adds a menu item to display a user interface featuring list and form Views.

Getting ready

The addon module implementing the library.book Model, provided in the previous recipe, is needed. The paths used are relative to our addon module location (for example, ~/odoo-dev/local-addons/my_module/).

How to do it…

To add a view, we will add an XML file with its definition to the module. Since it is a new Model, we must also add a menu option for the user to be able to access it.

Be aware that the sequence of the following steps is relevant, since ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required