Odoo Custom Module Development Part 4 - Menus, Actions, and Views
This is the fourth article in the Odoo custom module development series.
In Part 3, we secured our models. In this article, we will make the estate module visible and usable in the Odoo interface.
Without views, actions, and menus, your model exists in the database but users cannot work with it properly.
What we will build
We will add:
- a top-level Estate menu
- a menu item for properties
- a window action
- a list view
- a form view
- a search view
1. Create the XML file for views
Create this file:
estate/views/estate_property_views.xml |
2. Add a basic list view
Add this content:
<odoo> |
This gives a simple record listing for the estate.property model.
3. Add a form view
Extend the same file:
<odoo> |
The form view is where users will create and edit property records.
4. Add a search view
Search views make filtering and grouping easier.
Add this record inside the same XML file:
<record id="view_estate_property_search" model="ir.ui.view"> |
5. Add an action window
Actions tell Odoo which model and views to open.
Still inside the same file, add:
<record id="action_estate_property" model="ir.actions.act_window"> |
6. Add menus
Now create visible menu entries:
<menuitem id="menu_estate_root" name="Estate" sequence="10"/> |
A complete version of estate_property_views.xml should now include all these records inside one <odoo> block.
7. Load the file in the manifest
Update __manifest__.py:
'data': [ |
8. Upgrade the module
Run:
cd ~/odoo-dev/odoo |
Then start Odoo normally and refresh the browser.
You should now see the Estate menu with the Properties submenu.
9. Improve the form layout
Odoo forms become easier to use when fields are organized logically.
Practical tips:
- keep identity and pricing fields near the top
- place longer content such as descriptions inside notebook pages
- keep booleans and small numeric fields grouped together
- do not overload the first version of the form with too many tabs
You can refine the form later with status bars, buttons, and conditional visibility.
10. Add a separate menu for property types
If you created estate.property.type in the previous article, add another action and menu for it.
Example:
<record id="action_estate_property_type" model="ir.actions.act_window"> |
You can also create dedicated list and form views for this model.
11. Common mistakes
The menu appears but clicking it shows an access error
The user likely does not have the correct group or the access CSV is missing permissions.
XML parse error during upgrade
Check for:
- missing closing tags
- wrong
refvalues - duplicate XML IDs
- multiple
<odoo>root tags in the same file
The view does not update
You probably changed the XML file but did not upgrade the module.
Final words
Your custom module is now visible in the Odoo interface and users can open property records from menus.
In the next article, we will add model relationships, computed fields, onchange methods, and business logic.
Previous article: Part 3 - Security and Access Rights
Next article: Part 5 - Relations, Computed Fields, and Business Logic
Related posts
- /article/odoo-custom-module-development-part-2-models-and-fields/
- /article/odoo-custom-module-development-part-3-security-and-access-rights/
- /article/odoo-custom-module-development-part-6-reports-demo-data-and-tests/
- /article/odoo-custom-module-development-part-1-create-your-first-module/
- /article/odoo-custom-module-development-part-5-relations-computed-fields-and-business-logic/