Adding a menu item and window actions
The most obvious way to make a new feature available to users is by adding a menu item. When you click on a Menu item, something happens. This recipe walks you through how to define that something.
We will create a top-level menu and its sub-menu, which will open a list of all hostel rooms.
This can also be done using the web user interface through the Settings menu, but we prefer to use XML data files since this is what we’ll have to use when creating our add-on modules.
Getting ready
In this recipe, we will need a module with a dependency on the base
module, as the my_hostel
module adds new models to the hostel.room
. So, if you are using an existing module, please add the base
dependency in the manifest. Alternatively, you can grab the initial module from https://github.com/PacktPublishing/Odoo-17-Development-Cookbook-Fifth-Edition/tree/main/Chapter09/00_initial_module.
How to do it...
In an XML data file of our add-on...