Home › Curriculum › Odoo Developer › Wizards, scheduled actions, server actions and automation in code
Business logic and automation · 16 min · 17–20Wizards, scheduled actions, server actions and automation in code
TransientModel wizards, ir.cron jobs, server actions declared in modules, and writing robust batch jobs.
In this lesson
- Wizards on TransientModel
- Scheduled actions that behave
- Server actions, automation and Odoo 20 agents
Key points
- TransientModel + form target new; active_model/active_ids from context
- ir.cron: idempotent, batched, logged; _trigger() to wake it
- Server actions/automation shipped in XML call tested methods
- Odoo 20: crons/automation can invoke AI agents with approval for writes
Real-world example
A nightly cron synchronised 20,000 products from a supplier API and timed out at limit_time_real, restarting from zero every night. Rewriting it to process 500 at a time, store the last synced ID, commit per batch and re-trigger itself finished the sync in 40 minutes.
Questions and answers
How do you close a wizard after its action?
Return {'type': 'ir.actions.act_window_close'}.
Why avoid cr.commit() in normal methods?
It breaks transaction atomicity and tests; reserve it for long batch jobs like crons.