Guide to Adding Custom Menus and Actions in Odoo

TEAM-TRANSINES
April 7, 2026

Odoo have the menus and actions to organise its user interface and there is a set connection between these parts that makes the each screen that a user opens.

The developer can set up a menu to show what the system can do and an action to control what the system shows. This structure will makes sure that the record, view, and interaction in the app flows in the same way.

How Menus and Actions Work in Odoo

The model ir.ui.menu sets up the navigation entries that show up in the user interface. These entries are used by the system to show the hierarchical menus.

The model ir.actions.The act_window function tells a model to how to open and show itself. This action loads certain views that are connected to a model in the system.

When a user clicks on a menu in the Odoo framework, an action happens. The action loads a model using views that have been set up, which makes records show up on the screen.

Model Configuration in Odoo

Odoo ORM controls how data is stored and accessed in the database. The framework connects each model to a database table and each field to a column.

The developer uses the models to make the model.Class of the model. The system keeps track of the model name and description so it can identify it internally.

from odoo import models, fields

class CustomModel(models.Model):
    _name = 'custom.model'
    _description = 'Custom Model'

    name = fields.Char(string="Name")

The ORM layer makes a database table for the custom.model and keeps track of the values that were put into the name field. This makes sure that the every record is saved as structured data.

The field definition (fields.Char) tells you what kind of data the attribute is and what its label is. The system uses this definition to check the input and show the field in views.

View Definition in Odoo

The model ir.ui.view controls how the user interface shows records. The system uses XML architecture to make layouts like tree and form views.

<odoo>
    <record id="view_custom_model_tree" model="ir.ui.view">
        <field name="name">custom.model.tree</field>
        <field name="model">custom.model</field>
        <field name="arch" type="xml">
            <tree>
                <field name="name"/>
            </tree>
        </field>
    </record>

    <record id="view_custom_model_form" model="ir.ui.view">
        <field name="name">custom.model.form</field>
        <field name="model">custom.model</field>
        <field name="arch" type="xml">
            <form>
                <sheet>
                    <group>
                        <field name="name"/>
                    </group>
                </sheet>
            </form>
        </field>
    </record>
</odoo>

The XML definition tells list and form structures how to show fields. When the right action is taken, the system shows these views.

Action Configuration

The model is ir.actions.act_window tells the interface how to get to a model. This setting tells the system what view modes are available.

<record id="action_custom_model" model="ir.actions.act_window">
    <field name="name">Custom Model</field>
    <field name="res_model">custom.model</field>
    <field name="view_mode">tree,form</field>
</record>

The action definition connects the model to its views. When the action happens, the system loads tree and form views.

Menu Configuration

The model ir.ui.menu will links how to navigate the user interface with the specific actions. The system organisez the access points by using a menu hierarchy.

<menuitem id="menu_custom_root"
          name="Custom Menu"
          sequence="10"/>

<menuitem id="menu_custom_model"
          name="Custom Model"
          parent="menu_custom_root"
          action="action_custom_model"
          sequence="1"/>

The action attribute will connects the menu item to the action. When the user chooses the menu, the system will carries out the linked action.

Manifest Configuration

The file __manifest__.py will keeps track of the metadata and data files for the modules. During the module installation, the system reads this file.

{
    'name': 'Custom Menu Module',
    'version': '1.0',
    'depends': ['base'],
    'data': [
        'views/custom_model_views.xml',
    ],
    'installable': True,
}

The manifest configuration will loads the XML files and sets up dependencies. Based on this declaration, the system installs views, menus, and the actions.

The Odoo framework shows features in the interface in an entire set order. The model keeps the data, the view shows the data, the action loads the model, and the menu shows it to the user.

This structure makes sure that every interaction can be tracked, predicted, and connected to a specific backend definition.

For more details and technical assistance feel free to contact us.

"Automate Your Business with our Customized Odoo ERP Solutions"

"Get a Cost Estimate for Your ERP Project, Absolutely FREE!"

Get a Free Quote

Leave a Reply

Your email address will not be published. Required fields are marked *