Building Custom Dashboards Using ir.actions.client in Odoo

Dashboards are one of the most powerful ways to present business information in Odoo. Instead of navigating through multiple menus and reports, users can access key metrics, charts, and summaries from a single screen, making decision-making faster and more efficient.

Although Odoo provides several standard views such as Form, List, Kanban, Pivot, and Graph views, there are many situations where businesses need a completely customized interface tailored to their specific requirements. This is where ir.actions.client becomes extremely valuable.

The ir.actions.client model allows developers to launch custom frontend components and dashboards directly from Odoo menus using a unique tag. In simple terms, it acts as a bridge between Odoo's backend actions and custom JavaScript or OWL-based interfaces.

Understanding ir.actions.client

1. What is ir.actions.client?

ir.actions.client is a client-side action that executes custom frontend logic instead of opening one of Odoo's traditional views.

For example:

  • ir.actions.act_window opens standard views such as Form, Tree, Kanban, Calendar, or Pivot.
  • ir.actions.client opens a completely custom interface built using JavaScript or OWL components.

This makes it an excellent choice for building:

  • Interactive dashboards
  • Custom business screens
  • Advanced analytical pages
  • Interactive widgets
  • External integrations

2. Creating a Client Action

A client action is typically defined in XML:

<record id="action_my_dashboard" model="ir.actions.client">
    <field name="name">My Dashboard</field>
    <field name="tag">my_dashboard_tag</field>
</record>

The most important field here is:

<tag>

The tag is what connects the backend action to a frontend component.

3. What is the Tag?

Think of the tag as a unique identifier.

<field name="tag">my_dashboard_tag</field>

When Odoo executes the action action_my_dashboard, it searches for a frontend component that has been registered with the same tag:

my_dashboard_tag

If no component is registered with this tag, Odoo will throw an error because it doesn't know which interface should be displayed.

4. Registering the Dashboard Component

In Odoo 17 and later versions, dashboards are typically built using OWL components.

import { registry } from "@web/core/registry";

export class MyDashboard extends Component {}

registry.category("actions").add(
    "my_dashboard_tag",
    MyDashboard
);

This registration tells Odoo:

Whenever the tag my_dashboard_tag is called, render the MyDashboard component.

This is the key connection between the backend action and the frontend dashboard.

5. Adding a Menu Item

To make the dashboard accessible to users, create a menu item:

<menuitem
    id="menu_my_dashboard"
    name="Dashboard"
    action="action_my_dashboard"/>

When a user clicks the menu:

  1. The menu executes the client action.
  2. The client action reads the configured tag.
  3. Odoo loads the corresponding OWL component.
  4. The custom dashboard is displayed.

The entire process happens seamlessly behind the scenes.

Typical Dashboard Structure

A custom dashboard can include almost any type of business information, such as:

  • KPI cards
  • Charts and graphs
  • Progress indicators
  • Recent activities
  • Statistical summaries
  • Notifications and alerts

Some common metrics displayed on dashboards include:

  • Total Sales
  • Open Leads
  • Pending Approvals
  • Inventory Status
  • Project Progress
  • Employee Attendance

Unlike standard Odoo views, every aspect of the layout is fully customizable, giving developers complete control over the user experience.

Fetching Data from the Backend

Most dashboards require real-time data from Odoo models. There are several ways to retrieve this information.

Using the ORM Service

this.orm.searchRead(...)

Using Custom Controllers

@http.route(...)

The frontend can call backend methods and dynamically update the dashboard with live data, enabling users to make informed decisions based on the latest information.

Common Use Cases

ir.actions.client is widely used for building:

  • Executive dashboards
  • HR dashboards
  • Sales analytics screens
  • Approval management systems
  • Project monitoring dashboards
  • Manufacturing control panels
  • Custom portal interfaces

Whenever standard Odoo views are not sufficient, ir.actions.client becomes the preferred approach for creating highly interactive business applications.

Best Practices

To ensure good performance and a smooth user experience:

  • Keep database queries optimized.
  • Load data asynchronously whenever possible.
  • Avoid excessive RPC calls.
  • Build reusable OWL components.
  • Use meaningful and unique tags.
  • Implement proper loading indicators and error handling.
  • Cache data when appropriate.

A poorly designed dashboard can negatively impact system performance and user experience, especially when dealing with large datasets.

ir.actions.client is the foundation for building fully customized dashboards and interactive screens in Odoo. By connecting a backend action to a frontend component through a unique tag, developers can create rich user experiences that go far beyond the capabilities of standard Odoo views.

Understanding how client actions, tags, and OWL components work together is essential for any Odoo developer who wants to build modern, dynamic, and user-friendly dashboards.

Whether you're creating an executive dashboard, a real-time monitoring screen, or a completely custom business application, mastering ir.actions.client opens the door to endless possibilities in Odoo development.

Share this post
Tags
Archive
Smart Error Handling in Odoo: UserError vs ValidationError