Enable Dark Mode!
how-to-set-up-automated-actions-in-odoo-19.jpg
By: Milton Tom

How to Set Up Automated Actions In Odoo 19

Technical Odoo 20 Odoo Enterprises Odoo Community

Each business has tasks that are carried out repeatedly on a weekly basis: assign a follow-up task, inform a client about a status change, and make an important order pending approval. Performed manually, these actions are often forgotten, postponed or performed inconsistently.

Odoo Automation Action makes it possible to automate all these procedures. You just need to specify the conditions and the actions, and Odoo will execute your rule each time the condition is met. From Odoo 20, which was released in September 2026, the automation feature became integrated with AI agents of Odoo that could be launched from automation and scheduled actions.

This blog gives information about what Automation Actions are, how to configure them, and how to provide Automation Actions as code with a custom module.

What Are Automated Actions?

An automated action (technically a base.automation record) is a rule attached to one Odoo model, such as Contacts, Sales Orders, Tasks, or Stock Pickings. Each rule has three parts:

  1. A model: the type of record the rule watches.
  2. A trigger: the event that starts the rule.
  3. One or more actions: server actions that run when the trigger happens.

The domains further refine what records qualify, thus ensuring that the regulation applies when it should.

Step 1: Install the Module

Automation Actions exist within the Automation Rules application, which relies on the base_automation technical application. If it is not already installed, then it can be installed through the Apps menu. Most applications automatically install if they are needed for a particular application.

How to Set Up Automated Actions In Odoo 19-cybrosys

Step 2: Open the Automated Actions Menu

Activate developer mode.

Go to Settings > Technical > Automation > Automated Actions.

Click New to create a rule.

How to Set Up Automated Actions In Odoo 19-cybrosys

Step 3: Configure the Rule

Name and Model

Give the rule a descriptive name, such as "Notify manager on high-value orders", then select the model it applies to.

Choose a Trigger

  • Values Updated: A field changes, a user is assigned, a tag is added, and a stage or status changes
  • Email Events: On incoming email, on outgoing email
  • Timing Conditions: Based on a date field, after creation, after last update
  • Custom: On save, on deletion, on UI change
  • External: On webhook

Set the Domains

Use the domain filters to control when the rule applies:

  • Before Update Domain: the record must match this before the change.
  • Apply on: the record must match this after the change.

Combined, they let you catch a transition, for example, "was not Confirmed, is now Confirmed", so the rule fires once rather than on every later edit.

Add the Actions

Under Actions To Do, choose what happens. The available types include:

  • Update Record: set field values automatically.
  • Create Record: generate a new record in any model.
  • Send Email / Send SMS: notify a contact using a template.
  • Create Activity: schedule a to-do for a specific user, or dynamically for a user taken from a field on the record.
  • Add/Remove Followers: control who is notified on the record.
  • Send Webhook Notification: POST data to an external system.
  • Execute Python Code: custom logic for developers.
  • Execute Existing Actions: chain multiple server actions together.

Creating an Automated Action with Code

To manage rules through version control and deployment to different databases, create them using the XML file of your custom module. In this case, an activity has been created to review the activity of the salesperson for a sales order with a total value of 10,000 or above.

<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data noupdate="1">
        <!-- Server action: what to do -->
        <record id="server_action_review_large_order" model="ir.actions.server">
            <field name="name">Schedule review for large order</field>
            <field name="model_id" ref="sale.model_sale_order"/>
            <field name="state">code</field>
            <field name="code">
for order in records:
    order.activity_schedule(
        'mail.mail_activity_data_todo',
        summary='Review large order',
        user_id=order.user_id.id or env.user.id,
    )
            </field>
        </record>
        <!-- Automated action: when to do it -->
        <record id="automation_review_large_order" model="base.automation">
            <field name="name">Review large confirmed orders</field>
            <field name="model_id" ref="sale.model_sale_order"/>
            <field name="trigger">on_write</field>
            <field name="filter_pre_domain">[('state', '!=', 'sale')]</field>
            <field name="filter_domain">[('state', '=', 'sale'), ('amount_total', '&gt;=', 10000)]</field>
            <field name="action_server_ids" eval="[(4, ref('server_action_review_large_order'))]"/>
        </record>
    </data>
</odoo>

How to Set Up Automated Actions In Odoo 19-cybrosysHow to Set Up Automated Actions In Odoo 19-cybrosys

With Automated Actions, routine and often faulty actions become dependable background activities. You begin with a very basic rule, like an activity on status change; make sure it works as planned, and then expand from there. Using Odoo 20’s AI agents as an action target, we can expand from mere field updating to more intelligent workflows using the same trigger-action principle.

To read more about How to Configure Automated Actions in Odoo 18, refer to our blog, How to Configure Automated Actions in Odoo 18.


Frequently Asked Questions

What is an Automated Action in Odoo? What are its main components?

An Automated Action (a record from base.automation) is a rule allowing Odoo to automate some routine tasks for you. Every rule is linked to some particular model (Contacts, Sales Orders, Tasks, etc.) and consists of three elements: a model defining the type of record the rule acts on, a trigger, which launches the rule, and one or more actions that will be performed. Filters can limit the selection of records triggering the rule.

How to create an Automated Action in Odoo 20?

First, make sure the base_automation module is installed (the installation happens automatically with many applications). Then, switch developer mode on and navigate to Settings > Technical > Automation > Automated Actions > Create New Rule. Specify the name of the rule and the model it will act on. Choose a trigger – for example, value update, email, some timing criteria, event definition, or an external webhook. Specify the domain filters and select the actions, such as value update, email or SMS sending, activity creation, or execution of Python code.

What can be done to fire a rule just once after a record’s state changes and not every other time it is edited thereafter?

Put together both of the domain filters. Make use of the Before Update Domain filter for defining the condition that needs to be satisfied by the record before the change, while the Apply On domain filter should be used for defining the condition that the record has to satisfy after the change. This way, the record is caught when it “changes from Not Confirmed to Confirmed” (for example) and does not fire upon any other edit afterwards. For versionable rules across multiple databases, you can do this in the XML definition of your own module.

If you need any assistance in odoo, we are online, please chat with us.



0
Comments



Leave a comment



WhatsApp