Odoo automation rules: when to use them before a custom module
When a team keeps re-entering the same record updates, chasing approvals or sending reminders by hand in Odoo, automation rules and server actions can handle many of these routine steps without custom code. An automation rule watches a model for a trigger such as record creation, a field change or a time-based condition, checks conditions, and then runs actions such as setting field values, sending an email or creating an activity. A server action is a configurable piece of logic that runs a set of actions when a user clicks a button or when another rule calls it. The exact trigger types, action types and menu locations differ between versions, so the team should read the automation and server action pages of the Odoo documentation for the version it runs, starting from the Odoo upgrade documentation only for upgrade questions and the matching version's developer and user guides for these tools.
The decision between an automation and a custom module comes down to what the logic must do. A rule is usually enough when the logic reads fields that already exist, applies a fixed condition and writes results back to the same record or sends a notification. A custom module becomes necessary when the logic needs new data structures, complex calculations, loops over large sets of records, or behavior that must survive upgrades under version control and testing. Ask whether the rule will still be understood and maintained by someone other than its author, and whether a failed run can be found and corrected. Document each rule with its purpose, owner, trigger, conditions and the business owner who approved it, because undocumented rules are the usual reason later upgrades break silently.
Availability depends on the edition and the hosting plan, so the team must confirm this for its own setup before designing anything. Automation features and server action options can vary between Community and Enterprise, and Odoo's pricing page states that Studio and external API access sit on the Custom plan, which also limits hosting to Odoo.sh or on-premise. Check the features available in the installed version, then confirm which apps and technical settings the administrators can use, including developer mode access. If a rule depends on a feature the current plan lacks, the design must change before build starts.
Which automation option fits: rule, server action, scheduled action or custom module
This table compares automation rules, server actions, scheduled actions and custom modules by typical use, maintenance, testing and upgrade impact. Read each row against your own version and edition, since menu paths and available options vary. The main takeaway is to start with the simplest tool that fits and reserve custom code for logic the built-in tools cannot express.
| Option | Typical use | Who maintains it | How it is tested | Effect on upgrades |
|---|---|---|---|---|
| Automation rule | Trigger on record create or update, check conditions, then run actions such as setting fields or sending email | Functional admins who own the business process, with a documented owner per rule | Test on a duplicate database with records that match each condition branch | Usually carried through upgrades, but re-check triggers and field names after each major version |
| Server action | Run Python code or a chosen action on demand, from a button, menu or another rule | Developers or technical admins, since the code is stored in the database | Run against test records on a duplicate database and confirm the expected changes | Stored in the database rather than in a module, so review it manually during each upgrade |
| Scheduled action | Run a task at a set interval, such as clearing old records or syncing data | Technical admins, with a named owner for each scheduled job | Trigger a manual run on a duplicate database and check logs and resulting records | Review the interval and code after upgrades, and confirm the job still runs as expected |
| Custom module | Logic that rules, server actions and scheduled actions cannot express, or code that must be versioned and reviewed | Developers under version control, with a maintenance plan | Automated tests in the module, plus staging runs before each release | Requires porting to each new major version, which is the largest ongoing effort |
| Ownership and audit trail | Who can see and change each option | Confirm in your database who created each rule and where it is documented | Review the list of automation records during each release | Keep an inventory so that a version upgrade does not miss a rule |
How triggers, conditions and actions chain together in a rule
A automation rule in Odoo follows a fixed sequence: a trigger fires on a model, a condition filters which records qualify, and then the actions run against those records. The trigger is either an event on the record, such as creation or an update to a chosen field, or a time-based condition that checks records on a schedule. The condition is usually a domain, which is Odoo's filter syntax over the model's fields, so a rule can, for example, act only on orders in a given state with a set customer. Before building anything, confirm the exact trigger options in your Odoo version, since the list differs between releases and between Community and Enterprise builds, and write down which model each rule starts on.
The point that causes most trouble is that an action can write to another model, and that write can fire further rules. A rule that updates a related record may trigger a second rule on that record, which may update the first one again. Odoo does not give you a general cycle detector for this, so a chain that loops can run until it hits a limit or produces duplicate writes. Map every rule as a graph of model-to-model writes before go-live, and check that each write has a condition that becomes false once the target is already correct. Test with a duplicate database and records that match several conditions at once.
Conditions are evaluated against the record's state at the moment the trigger fires, not against the state it will have after the actions run. If a rule checks a field that an earlier action in the same chain has just changed, the result depends on action order and on whether the field was saved yet. Decide which values each condition reads, and confirm in your version whether the trigger evaluates before or after the save. Document these reads next to the rule, because a later change to a field name or a computed value can silently change which records qualify.
How a rule event moves from trigger to action and back
A change to a record fires the rule, and the rule checks whether that record matches its conditions before any action runs. If the actions change another record, that change can fire a rule again, so the path loops back to the trigger check. A guard branch stops repeated passes and sends failed runs to a person for review.
Decision path from a record change through conditions, actions and loop checks.
How to set up an automation rule safely in a test database
This sequence takes a routine business rule from a plain-language statement to a documented, tested automation rule that is ready for production review. Each step ends with a check so the team knows whether the rule is safe to move forward.
Write the business rule in plain language
The process owner, with a functional consultant or administrator, writes one sentence describing when the rule should run, which records it applies to, and what should happen. For example, an illustrative rule might state that when a sales order is confirmed for a customer marked as credit hold, the order moves to a review stage and the sales lead is notified. Keep the rule to one outcome. The step is complete when the process owner signs off the wording and nobody on the team describes it differently.
Identify the model and its fields
Next, the administrator confirms the Odoo model the rule belongs to and lists every field the rule will read in its conditions and every field it will write through its actions. The developer or administrator also checks whether any other rule, scheduled action, or custom code already touches those fields. Record the list in the rule notes. The step is complete when the team can name the model, the read fields, and the written fields without looking them up again.
Build the trigger and conditions in a duplicate database
The administrator creates the rule in a test copy of the database, not in production. Odoo documents database duplication with neutralization for test copies in on-premise setups, and reviewers should use an equivalent copy in their own hosting so that outgoing email, payment and connector settings do not reach real parties. Set the trigger first, then add the conditions, and leave the actions empty. The step is complete when the rule saves without errors and the conditions evaluate as written against a sample record.
Confirm only intended records match
Before any action is added, the tester selects a small set of records that should match and a second set that should not, and checks the conditions against both. Include boundary cases such as records with an empty field, a value just below the threshold, and records in another company or team if the database uses multiple companies. The step is complete when every matching record is in the expected set and no non-matching record appears, with the results written down.
Add one action at a time
The tester adds a single action, saves the rule, and runs it on the small test set. Adding several actions together makes it hard to tell which one caused an unexpected change. After each action, the tester compares the record before and after the change, checking the written fields listed in step two. The step is complete when the action changes exactly the intended fields and nothing else. Only then should the next action be added and tested the same way.
Check for loops and overlapping rules
The tester edits a matched record so the trigger fires again and confirms the rule does not repeat its own actions or start a chain of writes. The tester also lists every other automation rule, server action, and scheduled action that fires on the same model or fields and confirms that no second rule runs on the same change in a way that conflicts. Where a conflict exists, the team decides which rule owns the behavior and documents the order. The step is complete when a repeated change produces one result and the overlap list is signed off.
Review log output and performance
The tester reviews the server log during the test runs for errors, warnings, and unexpected messages from the rule or from connected modules. On a large model, the tester also notes whether the rule runs on every record write, which can slow screens and batch jobs, and asks whether the trigger can be narrowed. Confirm with the hosting or operations team how they will access logs in production. The step is complete when the log shows no unexplained errors and the team has a written note on the rule's expected load.
Document the rule before production
The administrator writes a short record for the rule that includes the plain-language purpose from step one, the model, the trigger, the conditions, each action, the read and written fields, the overlap list, the test records used, and the name of the owner who approves changes. Store the record where the operations team and auditors can find it. The step is complete when the process owner approves the documentation and the rule is scheduled to move to production through the team's normal change process.
Avoiding loops and slow rules on large models
Automation rules and server actions run inside the same transaction as the user's save, so a poorly scoped rule can slow every write or re-trigger itself. The cards below cover the failure patterns we see most often on large models and the design checks that prevent them before go-live.
Rules that update their own trigger
A rule fires on write, then writes back to the same record, which fires the rule again. The symptom is a save that hangs or a record whose fields keep changing. The cause is a rule with no guard on the fields it sets. The mitigation is a guard condition that checks whether the value actually changed, plus limiting the trigger to the fields that matter, so the rule does not re-enter itself. Test each rule by saving the record twice in a copy of the database.
Chains of rules across models
Rule A updates a sale order, which triggers rule B on the invoice, which updates a partner and triggers rule C. Each step looks harmless alone, but the chain multiplies work per save and can cycle. Map every rule that writes to another model and list the triggers it causes. Keep chains short, and move cross-model updates into one server action where the sequence is visible and testable.
Broad conditions on large tables
A rule with no domain, or with a condition that only checks the model, runs on every create and write across the table. On a table with millions of rows, that cost lands on routine saves made by users who never touch the rule's purpose. Add narrow domains such as state, company or record type, and check the query plan of the condition on a copy with production volume before enabling the rule.
Synchronous calls to external services
A server action that calls an external API during a user's save waits for that service on every trigger. If the service is slow or down, the user's save slows or fails. Move the call out of the save path: queue the work, record a pending state on the record, and let a scheduled action or worker send it with retries. Confirm timeouts and failure behavior with the owner of the external service.
Time-based rules scanning full tables
A scheduled rule that searches all records every run becomes slower as the table grows, and it can overlap with the next run. The cause is a domain that does not limit the scan to records changed or due since the last run. Use a date or state filter that narrows the search, process records in batches with a stored cursor or marker, and set the interval so one run finishes before the next begins. Review scheduled actions alongside worker limits and database load.
Rules that create records faster than users clear them
A rule that creates a task, activity or notification for every matching event can flood users and the database with records no one processes. The symptom is growing queues, slow list views and users ignoring alerts. Deduplicate before creating records, create one summary per batch instead of one per event, and agree on an owner and a clearance target for each generated record type before the rule goes live.
Documenting rules so they survive upgrades and staff changes
Undocumented automation rules are a risk because they run silently. A rule that updates a stage, sends an email or sets a field on save does its work without a user clicking anything, so most people in the business never see it fire. The rule also ties business logic to individual records and to the person who built it. When that person leaves, nobody can say why a rule exists, whether it still matches the sales or purchasing process, or which downstream reports depend on its output. A rule can also break quietly when the Odoo version or an installed module changes the fields, methods or models it relies on. Documentation turns these hidden dependencies into something a reviewer can check.
A rule register should hold one entry per automation rule or server action. Each entry needs the purpose in one or two sentences, a named business owner and a technical owner, the model and the trigger, the conditions and the actions in plain language, and the linked processes or reports. Add the test cases that prove the rule works, with the input record used and the expected result, and the date of the last review. Keep the register next to the configuration export so the two can be compared. Ask your partner or internal team to confirm the register format and where it lives, because the register is only useful if it is updated whenever a rule changes.
Include the register in the upgrade test plan. Odoo's upgrade documentation says an upgraded test database should be tested before the production database is upgraded. Use the register as the checklist for that test: run each test case on the upgraded copy, record the result, and log any rule that behaves differently or no longer triggers. Rules that depend on fields or modules changed in the new version need the closest attention, so flag them in the register before the upgrade starts. Confirm which upgrade path applies to your hosting type and edition, because the upgrade service and support windows differ between Odoo Online, Odoo.sh and on-premise.
Who can change automation and what it can reach
An automation rule or server action runs with the permissions of a user and can touch any record that user can reach. The cards below cover the decisions that determine how far a rule can go, who can change it, and how you find out when it breaks.
Who can create and edit rules
Creating or editing an automated action is itself a powerful permission, because a rule can change data across many records without a person clicking through each one. Decide in advance which roles may create rules, which may only view them, and who approves a change. Review the groups that hold these rights in your own database, since the list of users with configuration access often grows without anyone noticing.
On-premise docsRun-as user permissions
A server action executes with the access rights of the user who triggers it, or with the rights of a specified user for scheduled actions. If that account can write to accounting, inventory or HR records, a faulty rule inherits those powers. Check which user each rule runs as, and confirm that account holds only the rights the rule needs. Use a dedicated automation user where the rule's scope is narrow.
Credentials for external calls
Actions that post to an external webhook or call another system need credentials, usually an API key or token stored in the database. Anyone who can read or edit the action may be able to see that secret, so treat it as sensitive. Record which system each credential belongs to, who owns it, and how it is rotated when a person leaves or a key is exposed.
Audit trail of rule changes
When a rule changes, you need to know who changed it, when, and what the previous version did. Odoo's chatter and tracking features help for some fields, but confirm which rule and action fields are tracked in your version before relying on them. Where the trail is incomplete, keep rule definitions in version control or in an exported file so each change has a reviewable record.
Change control between test and production
Rules built directly in production are hard to review and easy to break. Build and test them in a duplicated test database first, then move the approved definition to production under a documented change. Duplicating a database with neutralization gives you a safer test copy, because outgoing email and external connections are disabled there. Confirm that your copy process neutralizes the settings your rules depend on.
On-premise docsMonitoring rule failures
A rule that fails silently can leave records half updated, and a rule that loops can consume workers and slow the whole database. Decide how failures reach a person: server log review, error notifications, or a periodic check of records a rule should have changed. Assign an owner for each rule and confirm where its errors are written in your own deployment.
What does it cost and take to build Odoo automation rules?
What drives the cost of building Odoo automation rules?
The main drivers are the number of processes being automated, how complex the data model behind them is, how much testing the rules need, and how many external systems they touch. Each rule has a trigger, conditions and actions, and each condition or action that reads or writes related records adds design and test work. A small set of rules on two or three models costs far less to specify and verify than a set that chains status changes across sales, inventory and accounting. Ask any partner to price the work from a written list of rules, each with its trigger, the records it reads and writes, and the people who approve it. Automation rules are configured inside Odoo, so most of the cost is analysis and testing rather than code.
Can an internal administrator build simple Odoo automation rules alone?
Yes, for simple cases. An administrator who knows the business process and the affected models can usually configure single-step rules, such as setting a field or sending a notification when a record changes state. The risk rises when rules chain together, when they change records in other models, or when they run on high-volume data. Those cases need a test database, a documented rule list, and someone who can read the effect of each action on related records. Before an administrator builds rules alone, confirm that they can test in a copy of production, that a second person reviews each rule, and that someone owns the rule list after go-live.
How long does it take to validate a rule set in a test database?
Validation time depends on the number of rules, how many of them interact, and how much realistic test data the team can load. Each rule needs a positive test, a negative test where its conditions are not met, and a check that it does not trigger another rule in a loop. Time-based rules add waiting, because the team must simulate dates or run the scheduled action manually. Ask for the validation plan as part of the quote, including the test cases, the test data source and the people who sign off each result. A partner can give a duration once the rule list and test data are defined.
What does the client need to provide for an automation rules project?
The client provides process owners who can explain the current steps and the exceptions, a list of the models and fields involved, and representative test data that includes edge cases. They also need a named approver who signs off each rule before it reaches production. Without these, the team spends effort guessing business intent, which is where most rework comes from. Ask who in your organization will answer questions within a set window and who has authority to accept a test result.
When is a custom module a better path than automation rules?
Use a custom module when the logic is too complex or too long-lived to keep in the database configuration. Examples include calculations that need Python code with unit tests, behavior shared across several databases, or logic that must survive large changes in the data model. Automation rules are quicker to change and easier for administrators to read, but they are harder to test in bulk and easier to lose track of as they multiply. A module is version-controlled and can be tested, but it needs developer effort and porting at each upgrade. Decide on a case basis and record the reason in the rule documentation.
How do automation rules affect the Odoo upgrade plan?
Rules are stored as data in the database, so they are carried across an upgrade, but their behavior can change when fields, models or defaults change between versions. Each rule and server action that references a field or model should be listed so the upgrade test can check it. Odoo on Odoo Online and Odoo.sh requires major version upgrades every two years, so rules that depend on behavior of a retiring version need review before that date. Include the rule list in the upgrade test plan and run each rule against the upgraded test database before production.
Does a quote for automation rules include any price or duration?
No. This section does not give a price or duration, because the effort depends on the number of rules, the models involved and the testing needed. DeployOpen agrees scope, deliverables and timelines in writing before work starts, and a quote follows from that written scope. To prepare for a quote, list your processes, the records they touch and the external systems involved.
Limits to confirm for your Odoo version and plan
Automation rules and server actions depend on what your Odoo version exposes, what your plan and hosting type allow, and how the server carries the load. Confirm each limit below against Odoo's documentation and your own environment before you commit to a design, since a rule that works on one version or plan may not be available on another.
Trigger and action types in your version
The set of triggers (on create, on write, on deletion, time-based) and action types (update record, create record, execute code, send email, call a webhook) changes between major releases. Check the automated actions screen in your own instance and read the release notes for your version, because a design that assumes an action type exists may need a different approach. Confirm before writing the requirements document, not after the build.
Upgrade docsPlan and hosting entitlements
Only the Custom plan includes external API access, Odoo Studio and custom modules, and only Custom can be hosted on Odoo.sh or on-premise. If a rule depends on a webhook, an API call or a Studio-built field, confirm that your plan and hosting type include it before you promise it to the business. Ask the vendor for the current plan matrix in writing, because plan contents are a commercial decision and can be revised.
Odoo pricingSupport window for the version
Standard support covers the first three years after a major release, including security updates and bug fixes. A rule built on a version nearing the end of standard support may need rework during the next upgrade, and security patches stop at that point. Look up the end date for your version in Odoo's support documentation and put it on the project calendar alongside the upgrade plan.
Support policyUpgrade cadence on Online and Odoo.sh
On Odoo Online and Odoo.sh, major version upgrades are mandatory every two years. Each upgrade can change trigger behavior, field names or the code that a server action runs, so every rule needs a regression test on an upgraded copy before production. Budget time for this as a recurring activity, not a one-off project, and record which rules depend on which fields.
Server performance limits
Rules run inside the same worker processes that serve users, so a slow rule on a large model delays every screen that touches it. Ask your hosting team how many workers and what time limits the server allows, and check whether the rule can run as a scheduled action in batches. Confirm the limits with your own load tests rather than assuming the defaults suit your data volume.
Conflicts with app logic
Sales, Inventory, Accounting and other apps already run their own onchange methods, constraints and automated actions. A new rule that changes a status or amount can clash with that logic, cause unexpected loops or break a validation step. Before you deploy, list every app that writes to the same model and test the rule against an end-to-end order or invoice in a staging copy.
How DeployOpen scopes, builds and supports Odoo automation
DeployOpen treats Odoo automation rules and server actions as configured business logic that needs a written scope, a tested build and documentation the client can keep. We work inside the client's own infrastructure, whether that is Odoo Online, Odoo.sh or a self-hosted install, and we agree the rules, owners and test cases before anything reaches production.
How we scope
- Inventory the routine steps that staff repeat, and name the model, trigger and owner for each one.
- Confirm which Odoo edition and hosting type the rules will run on before choosing configuration or code.
- Record the written scope, deliverables and timeline before work starts, since most engagements are fixed-scope.
How we build
- Configure triggers, conditions and actions in a duplicate database first, with test records that match production data shapes.
- Check time-based rules and server actions for loops, recursive writes and heavy searches on large models.
- Review each rule's effect on performance and record permissions before enabling it for real users.
How we hand over
- Document each rule with its purpose, trigger, conditions, actions, owner and the test cases that prove it.
- Walk the client's administrators through disabling, editing and reviewing rules without DeployOpen involvement.
- Deliver a change log that lists which rules were created, altered or retired during the engagement.
How we support
- Offer ongoing support, upgrades and retesting of rules as a retainer, scoped in writing.
- Retest affected rules when the client moves to a new Odoo version, using an upgraded test database before production.
- Review scheduled actions and rule logs periodically so that slow or conflicting automations are found early.

