Employment Hero Queue
A dependency free job queue inside Odoo, with backoff retries, a dead letter state and crash recovery.
Store price is USD 113 all-in: installing this also pulls the 2 paid ERP Heritage modules it depends on.
Why this module
Employment Hero Queue
A queue without the queue server
Jobs live in an ordinary Odoo model and drain on a schedule, so light to medium async work needs no message broker, no worker fleet and no extra service to secure or monitor.
Failures retry, then surface
A failing job retries on an exponential backoff up to a configurable limit, then moves to a dead letter state for review and manual requeue rather than vanishing or blocking the rest of the batch.
Concurrency safe by construction
Each drain claims its jobs under a database row lock that skips rows another worker already holds, so overlapping drains or worker processes never run the same job twice.
Day in the life
A webhook burst arrives during a busy morning
A producer enqueues one job per delivery on a per employee ordered channel. The scheduled drain claims a batch under a row lock, runs each handler and marks it done. One delivery hits a transient error, so it is parked as failed with its next attempt pushed out on an exponential backoff while the rest of the batch keeps moving. That delivery holds its channel so a later update for the same employee cannot overtake it. After repeated failures it lands in the dead letter view, where an administrator reads the captured traceback, fixes the cause and clicks Requeue. A second handler runs long; its heartbeat refreshes the claim so the reaper leaves it alone, and a job orphaned by a crashed worker earlier is reset and retried automatically.
Edge cases
The cases most modules quietly ignore.
In the shipped code today, each one a place where a cheaper module silently does the wrong thing.
A handler that raises is captured on its own job and the drain continues; one poison job never aborts the rest of the batch.
Each retry waits min(60 * 2 to the attempts, 3600) seconds, so a struggling endpoint is not hammered and the delay is capped at an hour.
SELECT ... FOR UPDATE SKIP LOCKED claims jobs and steps over rows another drain already holds, proven across two real connections, so no job runs twice.
A reaper resets jobs left running past a configurable threshold back to failed, counting the lost run as an attempt so max retries still caps it.
A background heartbeat on an autonomous cursor refreshes the claim timestamp while a long handler runs, so the reaper never reclaims a job that is legitimately in flight.
An ordered channel serialises same entity work by arrival order and holds the head job through its retry backoff, so a later delivery cannot overtake an earlier one mid retry.
When a job dead letters, the queue calls an optional _on_queue_dead_letter hook on the handler model so a poison delivery is surfaced, never silently dropped.
A handler that names an unknown model or missing method fails resolution cleanly and dead letters rather than crashing the drain.
Each job carries a company and a global record rule isolates jobs by company, so one company never sees or drains another's work.
What is inside
Built to do the job, end to end.
- The job model. eh.queue.job holds the handler, JSON payload, channel, state, attempts, max retries, run after time, last error traceback, company and claim timestamp, ordered by run after time then id.
- Enqueue and handler contract. Producers call enqueue with a handler in model.name:method form, a payload, an optional channel, run after time, retry cap and an ordered flag; the drain resolves and calls the method with the payload.
- Drain and reaper crons. One scheduled action drains due jobs oldest first every ten minutes; a second reaps stuck running jobs every fifteen. Both commit each outcome as it happens so a slow job never holds the others' results.
- Operator views. A list view colours failed and dead jobs, a search offers Queued, Failed, Dead Letters, Done and Due Now filters, a dedicated dead letter view and menu, and form and list Run Now and Requeue actions.
- Security and tuning. Suite user and manager access groups, a company isolation rule, and config parameters for the heartbeat interval and the stuck job threshold, all under the eh_hero namespace.
- Tested behaviour. An automated suite drives success, retry, dead letter, requeue, failure isolation, single cursor and true cross connection claim, reaper, heartbeat and ordered channel paths on real Odoo.
Honest about the edges
What this does not do, so nothing surprises you.
- This is the queue layer only. It executes handlers and manages retries; webhook verification, field mapping, idempotent upsert and the API transport live in the sibling Employment Hero modules, not here.
- Designed for light to medium volume that drains on a schedule. It is not a high throughput broker and does not aim to replace a dedicated job runner.
- Concurrency safe claiming relies on PostgreSQL row locks (SELECT ... FOR UPDATE SKIP LOCKED) and is supported on PostgreSQL only.
- By default the drain runs every ten minutes, so jobs are near real time rather than instant; lower the cron interval or use Run Now for immediate execution.
- The reaper threshold must exceed the longest legitimate handler runtime, otherwise a genuinely in flight job could be reclaimed.
- Requires the Employment Hero sync module, and targets Odoo 17 Community.
odoo async job queue, odoo background jobs, odoo retry backoff, dead letter queue odoo, odoo cron queue, odoo job queue no broker, employment hero odoo, odoo 17 queue, skip locked job claim, odoo webhook queue, exponential backoff retry, odoo task queue community
Need this fitted to the way you work?
ERP Heritage delivers end to end Odoo work: Odoo Implementation, Customization and Development, Integration, Migration, Consultation, Support and Training. We help teams put this module into production, shape it to their process, and keep it running.
We work with businesses across Australia (Melbourne, Sydney, Brisbane, Perth, Adelaide, Canberra) and the Middle East (Dubai, Abu Dhabi, Riyadh, Jeddah, Doha, Kuwait City, Muscat). Start a conversation at erpheritage.com.au or email info@erpheritage.com.au.
Languages
Available in 19 languages
The interface ships translated out of the box. Switch language in Odoo and the fields, menus, and messages follow.
Modules teams pair with this one.
Premium ERP Heritage modules that extend the same stack, each built to the same engineering bar.
Bring Employment Hero onboarding workflows, employee goals and contractor flags into Odoo Community as real recor...
Sync attendance clock events from the Employment Hero people platform into the stock Odoo Attendances app, keyed...
The Singapore country pack for the ERP Heritage Employment Hero integration
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Community Apps Dependencies | Show |
| Lines of code | 3967 |
| Technical Name |
eh_hero_queue |
| License | OPL-1 |
| Website | https://www.erpheritage.com.au/ |
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module