<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ethan Mercer</title>
    <description>The latest articles on DEV Community by Ethan Mercer (@ethan_mercer_eb399fbdfba9).</description>
    <link>https://dev.to/ethan_mercer_eb399fbdfba9</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4235582%2F23edfafb-1c7b-4d5c-875e-5931dfc7ceca.png</url>
      <title>DEV Community: Ethan Mercer</title>
      <link>https://dev.to/ethan_mercer_eb399fbdfba9</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ethan_mercer_eb399fbdfba9"/>
    <language>en</language>
    <item>
      <title>Odoo Automated Actions</title>
      <dc:creator>Ethan Mercer</dc:creator>
      <pubDate>Mon, 09 Nov 2026 17:28:10 +0000</pubDate>
      <link>https://dev.to/ethan_mercer_eb399fbdfba9/odoo-automated-actions-17fd</link>
      <guid>https://dev.to/ethan_mercer_eb399fbdfba9/odoo-automated-actions-17fd</guid>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Build a CRM follow-up rule around a defined transition and a narrow record filter. Odoo 20 automation rules combine triggers, conditions, and actions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check the subscription before installing Studio. Odoo’s Studio documentation says installing it on Standard triggers an upgrade to Custom.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Test repeated edits, missing assignees, and rollback in a copied database. Disabling a rule stops future execution; it does not undo activities or messages already created.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Keep deterministic follow-up separate from model-directed work. The CRM example uses a configured stage condition and predefined actions, with no model making the qualification decision.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Define the Automation Before Opening Studio
&lt;/h2&gt;

&lt;p&gt;Odoo automated actions are rules that execute predefined work when a record event occurs and its configured conditions match. In the Odoo 20 interface and documentation, the feature is described as automation rules. A rule can update a field, create an activity, or perform another supported action.&lt;/p&gt;

&lt;p&gt;For Odoo CRM automation, this walkthrough designs an internal follow-up: when an opportunity enters a chosen qualification stage, create a review activity for its salesperson and mark that the follow-up was created. The rule should ignore routine later edits and should not create another activity merely because the opportunity leaves and re-enters the stage.&lt;/p&gt;

&lt;p&gt;The example targets an Odoo 20 database with CRM and Studio available, appropriate administrative access, and a copied test environment. It does not assume that Community, every subscription, or an older version exposes the same interface.&lt;/p&gt;

&lt;p&gt;Use disposable opportunity records and test users. Keep external messaging and real customer actions outside this exercise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Confirm the Version and Plan for Odoo Automated Actions
&lt;/h2&gt;

&lt;p&gt;Confirm the database version, hosting arrangement, installed applications, and subscription before configuring the rule. A menu shown in an older tutorial may have a different label or behavior in your database.&lt;/p&gt;

&lt;p&gt;The Odoo pricing page lists Studio in the Custom offering and distinguishes environments that support custom development. Check the subscription change identified above against your account’s terms before installing applications. Include any change in continuing costs in the approval decision.&lt;/p&gt;

&lt;p&gt;This guide follows the documented Studio route. It does not require a third-party automation module, an external API integration, or a custom Python server action. If those become necessary for a different workflow, assess their hosting and maintenance requirements separately.&lt;/p&gt;

&lt;p&gt;Before proceeding, record the version and the configuration in the test database. Identify the administrator who will reproduce the accepted rule in production and the operations owner who will validate its business behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  Specify the CRM Follow-Up Contract
&lt;/h2&gt;

&lt;p&gt;Use a written contract to distinguish a qualifying transition from a record that merely remains in the target stage. The following names are example labels to configure in your test database.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Model: Use CRM opportunity records on the Lead model.&lt;/li&gt;
&lt;li&gt;Target stage: Select a designated test stage named Qualified.&lt;/li&gt;
&lt;li&gt;Trigger field: Watch changes to Stage.&lt;/li&gt;
&lt;li&gt;Required assignee: The Salesperson field must be set.&lt;/li&gt;
&lt;li&gt;Repeat guard: Add a Boolean field named Qualification Follow Up Created.&lt;/li&gt;
&lt;li&gt;Business action: Create an internal To Do activity for the opportunity’s salesperson.&lt;/li&gt;
&lt;li&gt;Guard update: After creating the activity, set Qualification Follow Up Created to true.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use the field selector to target the correct record and relation. Stage names and record identifiers are database-specific; do not copy a numerical stage ID from another database.&lt;/p&gt;

&lt;p&gt;The Boolean records the intended once-per-opportunity behavior. If the business instead wants a fresh activity on every return to Qualified, that is a different contract and needs different tests. Do not silently reset the marker whenever a stage changes.&lt;/p&gt;

&lt;p&gt;The CRM record is the source of truth. This rule does not infer qualification from email content or decide who should own an opportunity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a Narrow Rule in the Test Database
&lt;/h2&gt;

&lt;p&gt;Create the rule from the intended model so its fields and actions apply to CRM opportunities. Odoo documents opening Studio, selecting Automations, and creating a new rule. Available triggers depend on the model.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the copied CRM database and an opportunity form. In Studio, create the Boolean repeat-guard field. Confirm it starts false on the disposable records. Record its actual technical name for handover.&lt;/li&gt;
&lt;li&gt;Open Automations and create a rule with a descriptive name such as Create Qualified Opportunity Follow Up. Confirm the model is the CRM Lead model used by the opportunity form.&lt;/li&gt;
&lt;li&gt;Choose the documented Custom trigger On create and edit. In When updating, select Stage. Odoo warns that omitting the watched fields can cause multiple executions per record.&lt;/li&gt;
&lt;li&gt;With developer mode available, configure Before Update Domain so Stage is not the selected Qualified stage. Configure Apply on so Type is Opportunity, Stage is Qualified, Salesperson is set, and Qualification Follow Up Created is false. The type filter keeps ordinary leads outside the example’s scope.&lt;/li&gt;
&lt;li&gt;In Actions To Do, add Create Activity. Select the internal To Do activity type, give it a distinctive summary such as Review Qualified Opportunity, and assign it through Dynamic User to the opportunity’s Salesperson. Set an appropriate due interval for the test.&lt;/li&gt;
&lt;li&gt;Add an Update Record action after activity creation. Set Qualification Follow Up Created to true. Keep Stage as the watched field; the marker update should not itself be the event the rule watches.&lt;/li&gt;
&lt;li&gt;Save the rule and document its purpose, actions, guard, owner, and rollback steps in the available notes. Run the test cases before reproducing it in production.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Odoo distinguishes conditions before the triggering update from those after it. Before Update Domain is not checked when a record is created. A new opportunity created directly in Qualified can therefore match the post-condition. The test contract below treats that as eligible when an assignee exists and the marker is false.&lt;/p&gt;

&lt;p&gt;If your business wants existing-record transitions only, use a design that explicitly excludes direct creation and validate it in your installed version. Do not assume the pre-update condition handles creation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test Odoo Automated Actions With Disposable Records
&lt;/h2&gt;

&lt;p&gt;Test both the expected action and the absence of unwanted actions. Inspect the opportunity’s activity list and the guard field after each case, rather than treating a successful save as evidence of correct behavior.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Existing opportunity enters Qualified. Move an assigned opportunity from another stage to Qualified with the repeat guard set to false. Expected result: a follow-up activity is created and Qualification Follow Up Created becomes true.&lt;/li&gt;
&lt;li&gt;Description changes while the stage stays Qualified. Edit the description without changing Stage. Expected result: no additional follow-up activity.&lt;/li&gt;
&lt;li&gt;A processed opportunity returns to Qualified. Move an opportunity whose repeat guard is already true out of Qualified, then back into it. Expected result: no additional follow-up activity.&lt;/li&gt;
&lt;li&gt;An unassigned opportunity enters Qualified. Move an opportunity with no salesperson into the target stage. Expected result: no activity and no marker update.&lt;/li&gt;
&lt;li&gt;A new opportunity is created directly in Qualified. Create an assigned opportunity in the target stage with the repeat guard set to false. Under the stated contract, it is eligible for a follow-up activity because Before Update Domain is not checked during creation. Confirm the actual execution in the test database.&lt;/li&gt;
&lt;li&gt;A non-qualifying record is saved. Save a record that does not meet the configured conditions. Expected result: no follow-up activity and no guard change.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Also test a bulk stage update and any import or integration route your team actually uses. User-interface behavior is insufficient evidence for those routes. Record the observed outcome, user permissions, and resulting activity ownership separately.&lt;/p&gt;

&lt;p&gt;The missing-assignee case needs an operating procedure. Under the rule above, assigning a salesperson later does not create a Stage update. Have the operator resolve ownership before qualification, or create a separately designed retry route. Do not add extra watched fields without revisiting the transition conditions and duplicate tests.&lt;/p&gt;

&lt;p&gt;For failed or interrupted execution, inspect both the created activity and the marker before retrying. The guard helps control repeated sequential events; it is not a claim of exactly-once execution under concurrent requests. If concurrent processing or strict uniqueness is material, have a developer design and test an appropriate transactional implementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use a Small Code Model to Review the Gate
&lt;/h2&gt;

&lt;p&gt;A pure Python model can make the intended decision easy to discuss, but it does not execute or validate Odoo. The example below represents the business gate with strings and Booleans; it is not an ORM domain or server-action snippet to paste into Studio.&lt;/p&gt;

&lt;p&gt;`def should_create_follow_up(before_stage, after_stage,&lt;br&gt;
                            assigned, already_created,&lt;br&gt;
                            creating=False):&lt;br&gt;
    enters_stage = creating or before_stage != "Qualified"&lt;br&gt;
    return (&lt;br&gt;
        enters_stage&lt;br&gt;
        and after_stage == "Qualified"&lt;br&gt;
        and assigned&lt;br&gt;
        and not already_created&lt;br&gt;
    )&lt;/p&gt;

&lt;p&gt;assert should_create_follow_up("New", "Qualified", True, False)&lt;br&gt;
assert not should_create_follow_up("Qualified", "Qualified", True, False)&lt;br&gt;
assert not should_create_follow_up("New", "Qualified", False, False)&lt;br&gt;
assert not should_create_follow_up("New", "Qualified", True, True)&lt;br&gt;
assert should_create_follow_up(None, "Qualified", True, False, creating=True)`&lt;/p&gt;

&lt;p&gt;This code models the positive and negative cases, including the creation exception. The Odoo test matrix must still verify that the selected trigger, fields, conditions, action order, permissions, and assignment produce the same behavior in the database.&lt;/p&gt;

&lt;p&gt;For a no-code rule, keep the accepted configuration record alongside these expected outcomes. If the process later requires code, use the same cases as acceptance criteria and add tests for concurrency and failure recovery where relevant.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshoot Scope Before Adding More Actions
&lt;/h2&gt;

&lt;p&gt;Check the trigger, watched fields, conditions, and action ownership before making the rule more complicated. A missing activity can have a straightforward cause: the record did not undergo the watched event or did not match the post-condition.&lt;/p&gt;

&lt;p&gt;If activities repeat, inspect the actual updated fields, the guard value, other active rules, and the route that performed the write. Confirm the activity marker is being set by the intended action and that another automation does not reset it.&lt;/p&gt;

&lt;p&gt;If an activity has the wrong owner, review the Dynamic User field path. Odoo’s Create Activity action supports dynamic assignment from a user linked to the record; the correct relation matters.&lt;/p&gt;

&lt;p&gt;If a time-based rule behaves differently, stop applying assumptions from this event-driven example. Odoo 20 documents a scheduled checker for timing conditions and a setup step that initializes execution history to avoid retroactive work. Read that sequence before building reminder rules.&lt;/p&gt;

&lt;p&gt;Keep diagnosis evidence specific: affected record, user, changed fields, expected matching conditions, activity outcome, and guard outcome. That is more useful than a screenshot of the rule’s name alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Automated Actions and AI Agents Have Different Responsibilities
&lt;/h2&gt;

&lt;p&gt;An automation rule defines the event and configured response. An AI action can introduce model-directed interpretation or tool use inside that process. A deterministic CRM follow-up does not need a model to decide that a known stage changed.&lt;/p&gt;

&lt;p&gt;Odoo 20 documentation includes AI agents and AI actions, and describes Update with AI as requiring the Odoo AI app. Those capabilities need their own permissions, evaluation, and operating boundaries.&lt;/p&gt;

&lt;p&gt;Also distinguish a time-based automation rule from a general scheduled action. Both involve scheduling, but their configuration and execution conditions differ. Choose the mechanism that matches the event and workload instead of treating every background task as the same feature.&lt;/p&gt;

&lt;p&gt;For this example, the human defines qualification and ownership. The rule schedules a known internal activity. Keep that boundary intact until a different business requirement justifies changing it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Promote the Rule With a Recovery Plan
&lt;/h2&gt;

&lt;p&gt;Promote only after the business owner accepts the observed test results and the administrator can reproduce the configuration. Keep the first production scope narrow and inspect its actual outputs.&lt;/p&gt;

&lt;p&gt;Record the rule name, model, trigger, watched fields, domains, selected stage, custom field name, ordered actions, and test evidence. Have the operations owner confirm how unassigned opportunities and intentional retries will be handled.&lt;/p&gt;

&lt;p&gt;WiserBrand’s business process automation offering covers process mapping, tool integration, and maintenance. For an Odoo project, ask the proposed team to demonstrate the exact trigger, permissions, repeat guard, and recovery procedure in the target version. Define the support scope before handover.&lt;/p&gt;

&lt;p&gt;To stop future execution, disable or archive the rule through the controls available in the database. Preserve the configuration for diagnosis. Then identify activities already created and review them before correction. Disabling the rule does not remove them or reverse business actions.&lt;/p&gt;

&lt;p&gt;If a guard was set incorrectly, inspect the opportunity and its activity history before resetting it. Blindly clearing markers can make previously processed opportunities eligible again. Do not delete legitimate activities during cleanup simply because their summaries match the test phrase.&lt;/p&gt;

&lt;p&gt;Assign a maintenance owner to retest the rule after upgrades, stage changes, field changes, or revisions to related automations. A small rule still has dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What Are Odoo Automated Actions?
&lt;/h3&gt;

&lt;p&gt;Odoo automated actions are configured rules that perform work when a supported event occurs and the record matches defined conditions. In Odoo 20, the documentation calls them automation rules. A rule combines a model, trigger, filters, and actions such as updating a record or scheduling an internal activity.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do Automated Actions Require Python?
&lt;/h3&gt;

&lt;p&gt;No. Supported actions can be configured through Studio, including record updates and activity creation. Python becomes relevant when the required behavior exceeds those configuration options. Check the version, subscription, hosting, and maintenance implications before adding code. This walkthrough uses predefined actions and includes a separate illustrative model for discussing its gate.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Can I Reduce Duplicate Activities?
&lt;/h3&gt;

&lt;p&gt;Watch only the fields relevant to the event, distinguish the pre-update and post-update conditions, and add a persistent repeat guard when the business requires once-per-record behavior. Test later edits, stage re-entry, and retries. These measures do not by themselves prove exactly-once behavior under concurrency or every integration route.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does Disabling a Rule Undo Its Earlier Work?
&lt;/h3&gt;

&lt;p&gt;No. Disabling a rule is a way to stop future execution, not a reversal of completed actions. Review the affected records and outputs before making corrections. Activities may need individual cleanup, while external messages cannot be unsent. Preserve configuration and execution evidence so the owner can determine the right recovery action.&lt;/p&gt;

&lt;h3&gt;
  
  
  Start With a Transition You Can Verify
&lt;/h3&gt;

&lt;p&gt;Use Odoo automated actions when a clear event, reliable condition, and predefined response match the business need. Begin with an internal action whose result is easy to inspect.&lt;/p&gt;

&lt;p&gt;Use the configuration record and test matrix as a starting brief for an implementation discussion with WiserBrand. Build the CRM rule in a copied database and record the observed results. Promote it only when its configuration, owner, exception procedure, and recovery steps are understood by the people who will operate it.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>odoo</category>
      <category>productivity</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
