Odoo Scheduled Actions in Odoo 19 and 20: ir.cron, Batching and Fixes
Odoo scheduled actions explained for Odoo 19 and 20: ir.cron in the UI vs code, safe batching, timezone rules, why a cron is not running, and failures.
Most guides stop at "add a record and set an interval". The hard part is the 2 a.m. run that meets 80,000 records. Our Odoo development company team writes jobs that survive that, checked here against the 19.0 and 20.0 source.
Related service: Odoo upgrade services — version upgrades with custom modules ported and tested.
This is for developers, technical leads and admins who own background jobs. If you need "when a record changes, do X", read our guide to Odoo automation rules in Odoo 19 and 20; this post covers timed and batch work.
What is an Odoo scheduled action (ir.cron)?
An Odoo scheduled action is an ir.cron record that runs an "Execute Code" server action at a set interval. The model inherits from ir.actions.server, so every scheduled action is also a server action with a model and a code field.
You find them in developer mode under Settings, Technical, Automation, Scheduled Actions. Key fields on the form:
| Field | What it controls | Default in 19.0 and 20.0 |
|---|---|---|
| Scheduler User | Whose rights and timezone the job uses | The user who created it |
| Execute Every | Gap between runs, minutes to months | 1 month |
| Next Execution Date | When the job is next due, stored in UTC | Now |
| Last Execution Date | Last successful run, passed to the code | Empty |
| Priority | Order when several jobs are due; 0 runs first | 5 |
| Failure count | Consecutive failures, reset on success | 0 |
"Number of Calls" and "Repeat Missed" exist in 17.0 but were removed in 18.0, so "set Number of Calls to -1" advice does not apply to 19 or 20.
Odoo automation rules vs scheduled actions: which one do you need?

Use an automation rule when a record event should cause the action, and a scheduled action when time or volume should drive it.
Older guides say automated actions vs scheduled actions; same question.
| Question | Automation rule | Scheduled action (ir.cron) |
|---|---|---|
| What starts it | Create, update, stage change, date field, webhook | A timer, or a trigger from code |
| Scope | The records that changed | Any records you search for |
| Volume | Small, per event | Large, in batches |
| Who builds it | Functional admins, Studio users | Developers |
| Testing | Manual on sample records | Unit tests with method_direct_trigger |
Time-based automation rules run through a scheduled action called "Automation Rules: check and execute". It ships inactive with a 4-hour interval, and Odoo turns it on and shortens it to a tenth of your shortest rule delay, never below 1 minute.
So a delayed rule that never fires is often a cron problem. See enterprise workflow automation for where each layer fits.
Should you create a scheduled action in the UI or in code?
Create it in the UI only for a one-line call or a short test, and ship anything you depend on as a module with an XML record and a Python method.
- UI is fine for: a one-line call to an existing method, a staging test, or a clean-up you will archive next week.
- Code is right for: loops, external calls, logic that must match on every database, and anything needing tests and review.
A module record looks like this. Keep the code field to one method call:
```xml
Wrap it in `` if admins may change the interval, so a module update does not reset it. Our Odoo module development guide covers data file basics.
How do you batch an Odoo cron job safely?
Process a limited batch per call, report it with `_commit_progress()`, and let the scheduler call the method again until nothing remains. The Odoo 20 scheduled actions reference says a batch should take no more than "a few seconds" and not to reschedule the job yourself.
```python def _cron_sync_vendor_prices(self, limit=200): domain = [('price_sync_needed', '=', True)] records = self.search(domain, limit=limit) records._sync_vendor_price() remaining = (0 if len(records) < limit else self.search_count(domain)) self.env['ir.cron']._commit_progress( len(records), remaining=remaining) ```
What the 19.0 and 20.0 scheduler does with that call:
- It runs your server action in its own cursor and tracks a progress record.
- `_commit_progress()` stores done and remaining counts and commits, so finished batches stay saved.
- While work remains, it calls the action again in the same run.
- It stops after at least 10 calls and a minimum time: 10 seconds in 19.0, 120 seconds in 20.0.
- If records still remain, the job is "partially done" and requeued once other due jobs have had a turn.
- When remaining hits 0, or the code never reports progress, the job is "fully done" and waits for its next interval.
`_commit_progress()` returns the seconds left; if you loop yourself, stop at 0. Odoo 20 adds `_rollback_progress()` for a failed record, and `_notify_progress()` is deprecated since 19.0.
Make each batch idempotent, and filter on a field the batch changes.
How does timezone affect Odoo scheduled actions?
The next execution date is stored in UTC, but Odoo adds the interval in the scheduler user's timezone, so a 06:00 job stays at 06:00 local across daylight saving. The source comment says the interval "won't be fixed, but the hour will stay the same".
The timezone comes from the scheduler user's preferences. If that user has none, Odoo uses UTC and a daily job shifts an hour when clocks change. Set it on the scheduler user, often OdooBot, first.
- "Today" in code: `fields.Date.today()` uses the server date; use `fields.Date.context_today(record)` for a local date.
- Missed runs: after downtime, Odoo moves the next date past now and runs the job once, not once per missed interval.
- Time windows: use `lastcall` from the context to process everything since the last successful run.
Why is my Odoo cron not running?
Most "Odoo cron not running" cases come down to an inactive job, a job that keeps failing, a neutralized copy, a busy cron worker or a server that never starts cron workers.
| Symptom | Likely cause | Fix |
|---|---|---|
| Job archived on its own | 5 failures in a row over 7+ days | Fix the logged error, reactivate |
| Next date stuck in the past | No cron worker reaches this database | Check max_cron_threads and the database list |
| Works with Run Manually only | Code raises an error, or user lacks rights | Read the traceback, check the scheduler user |
| All jobs off on a copy | Database was neutralized | Re-enable only the jobs you need |
| Skipped after module update | Modules stuck "to upgrade" | Finish or cancel the update |
One Odoo forum user found their scheduled action ran manually but not automatically. The code ended by raising a UserError to show log lines, which rolls back the transaction, so every run failed.
On self-hosted servers, check the Odoo command-line reference. `--max-cron-threads` defaults to 2, and `--db-filter` does not limit cron workers, so without `--database` they poll every database.
Cron workers wake every 60 seconds, or sooner when a trigger is due. If one long job holds both workers, the rest wait. Our Odoo performance tuning checklist covers worker sizing.
What happens when an Odoo scheduled action fails or times out?
A failed run rolls back, counts as a failure and the job waits for its next interval; after enough failures over enough days, Odoo switches it off. The Odoo 19 scheduled actions docs list the safety rules.
- Timeouts: after 3 consecutive timeouts with no progress, the next run is skipped and counted as failed.
- Deactivation: at 5 failures, with the first more than 7 days old, the job is set inactive and the admin is notified.
- Early warning in 20.0: Odoo 20 adds a "will be deactivated if you don't take action" notice first.
- Hard limit: `--limit-time-real-cron` kills the run; by default it falls back to `--limit-time-real` (120 seconds).
- Partial progress: a run that committed progress and then crashed is "partially done", not failed.
The base `_notify_admin()` only writes to the server log, so on a self-hosted server nobody sees it unless you watch logs. A regular Odoo health check catches archived jobs early.
How do Run Manually and triggers work in Odoo 19 and 20?
"Run Manually" runs the job now through the normal scheduler path, and `_trigger()` asks the scheduler to run it soon or at a set time without changing its interval.
Run Manually needs write access and refuses to start if a worker is already running the job. It runs in your browser request, so test a small batch.
From code, call `_trigger()` on the cron record after a user action creates work, with an optional datetime or list of datetimes. Odoo 20 adds a `coalesce` window in minutes to group triggers into fewer wake-ups. While a job runs, editing it raises "Record cannot be modified right now".
How do scheduled actions behave on staging, Odoo.sh and neutralized databases?
Neutralizing a database switches off every scheduled action except the base auto-vacuum job, so copies do not email customers or call real APIs.
The Odoo.sh branches documentation says staging copies are neutralized and crons run less often when nobody uses the database. On development branches they do not run while the database is idle.
On a neutralized database, re-enable only the job you test and point its connectors at a sandbox. Our Odoo staging environment checklist has the full list.
Which scheduled actions matter most by industry?
The scheduled actions that hurt most when they stop are the ones tied to money, stock and compliance deadlines.
| Industry | Pain or cost driver | Odoo approach | How iVentureTeam helps |
|---|---|---|---|
| Manufacturing | Stale cost prices on quotes and POs | Hourly batched price sync | Build the sync with progress reporting |
| Distribution | Reordering misses a night | Monitored reorder crons | Add failure alerts and log reviews |
| eCommerce | Order and stock sync backlog | Batched imports with triggers | Tune batch size and workers |
| Subscriptions | Renewal invoices not created | Daily cron in the right timezone | Fix scheduler user timezone and rights |
| Finance | E-invoice status checks pile up | Polling cron with retries | Add idempotent retries and alerts |
How iVentureTeam helps with Odoo scheduled actions

iVentureTeam writes, audits and repairs Odoo scheduled actions so background jobs run on time and fail loudly, not silently. We have delivered 150+ ERP projects across 35+ countries with 40+ Odoo specialists, led by a consultant with 13+ years in Odoo.
- Cron audit: every active and archived job, its failure history, scheduler user and timezone.
- Batch rewrites: long jobs moved to `_commit_progress()` batches for Odoo 19 and 20.
- Custom modules: our Odoo customization services turn UI-made jobs into tested module code.
- Ongoing care: our Odoo ERP support team watches logs and fixes jobs before they switch off.
Odoo scheduled actions case study: Mechanical Products IL
A US precision components maker used scheduled actions to keep cost prices in sync, on Odoo 17 rather than 19 or 20. It predates the 19.0 progress API, so the batching code above was not used, but the design idea is the same.
Mechanical Products IL ran its product catalog on manual Excel imports. Cost prices did not update on import, so quotations and purchase orders went out with stale numbers.
We built a product-lifecycle module that creates, updates and archives products from the sheet. Scheduled actions keep standard_price fields in sync, and POs pull the latest vendor price. It took 6 weeks; see the Mechanical Products IL product data automation case study.
The bottom line on Odoo scheduled actions
Treat every Odoo scheduled action as production code: small batches, reported progress, a scheduler user with the right rights and timezone, and someone watching for failures.
Ship jobs in a module, test with Run Manually on a small batch, and review archived jobs monthly. For AI-driven background work, see our guide to automating Odoo workflows with AI.
Ready to fix the scheduled actions that keep failing?

Send us the job names and the last traceback, and we will tell you what is wrong. Get your Odoo cron jobs reviewed by a developer, call +91-90235-15208, or email business@iventureteam.com.
Frequently Asked Questions
What is a scheduled action in Odoo?
+
It is an ir.cron record that runs an "Execute Code" server action at a set interval, as a chosen scheduler user. You manage them in developer mode under Settings, Technical, Automation, Scheduled Actions.
How do I create a scheduled action in Odoo 19?
+
In developer mode, open Settings, Technical, Scheduled Actions and click New. Pick the model, write one line calling a method, set the interval and scheduler user, and save. For anything lasting, define it in a module.
Why is my Odoo scheduled action not running automatically?
+
Check that it is active, that its code does not raise an error, that the scheduler user has rights, and that cron workers run for that database. On copies, neutralization may have switched it off.
What is the difference between automation rules and scheduled actions in Odoo?
+
Automation rules react to record events such as create, update or a date field. Scheduled actions run on a timer and process any records in batches. Time-based rules themselves run through a scheduled action.
Does Odoo run missed scheduled actions after downtime?
+
No. Odoo moves the next execution date past the current time and runs the job once. "Repeat Missed" was removed in Odoo 18, so write code that processes everything since the last run.
What timezone do Odoo cron jobs use?
+
The next execution date is stored in UTC, and the interval is added in the scheduler user's timezone, so daily jobs keep their local hour. If that user has no timezone, Odoo uses UTC.
Why did Odoo deactivate my scheduled action?
+
Odoo archives a job after 5 consecutive failures when the first is more than 7 days old. Find the traceback in the server log, fix the cause, then reactivate the job.
Free Odoo implementation plan
Planning your Odoo implementation?
A senior consultant reviews your processes and sends a phased roadmap, what to set up first and a fixed-price range.
Free, with no obligation. A senior consultant replies within 12 business hours.
Free Odoo tools
All tools- Odoo Health CheckVersion, modules, findings and upgrade cost
- Odoo App SelectorWhich apps you need, by industry
- Odoo Project EstimateIndicative cost and timeline in minutes
- Odoo Implementation Cost CalculatorImplementation cost and timeline, in minutes
- Odoo Migration Cost CalculatorVersion jump or legacy ERP, priced in minutes
Continue reading
Odoo 19 POS Review: QR Menu, Offline Mode, Hardware and Odoo 20
Odoo 19 POS reviewed: QR menu and kiosk ordering, offline limits, printers, IoT Box and payment terminals, plus what Odoo 20 changes and when to upgrade.
Odoo QWeb Report Guide: Build Custom PDF Reports in Odoo 19 and 20
Build an Odoo QWeb report in Odoo 19 and 20: report action, template, paperformat, currency formatting, invoice inheritance and fixes for broken PDFs.
Odoo 19 vs Odoo 20: Which to Choose for a New or Running Project
Odoo 19 vs Odoo 20 for a new or running project: a decision framework by go-live date, modules and customization level, plus switch costs and support.
