| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 691 |
| Technical Name |
praetorx_base |
| License | LGPL-3 |
| Website | https://praetorx.net |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 691 |
| Technical Name |
praetorx_base |
| License | LGPL-3 |
| Website | https://praetorx.net |
PraetorX Base
Queue Jobs, Batch Processing & Validation Framework for Odoo 19
Reusable technical patterns for building robust Odoo modules. Background job queue with cron processing, a validation mixin with HTML summaries, a state-machine batch processing mixin, and an OWL split-view component — all ready to inherit in your own models.
praetorx.net | Syntax & Sabotage
Core Patterns
Background job processing via cron. Create jobs with model name, method, and record IDs. Processed in FIFO order, up to 100 per minute. Retry failed jobs or cancel pending ones.
Structured validation returning errors and warnings with HTML-formatted summaries. Inherit praetorx.validation.mixin and override validate_all() in your model.
State machine for parent-child workflows: Draft → Validated → Posted (and Cancel/Reset). Inherit praetorx.batch.mixin — includes validation hooks, deletion guards, and button visibility.
OWL component for master-detail UI patterns. Configurable panel widths, item selection callback, scoped template slots for master and detail panels.
Three-tier hierarchy: User → Manager → Administrator. Used by all PraetorX modules for consistent access control. Admin assigned to base.user_admin by default.
Configurable report behavior: download PDF to disk or open in a new browser tab. Set once in Settings, applies to all PraetorX report actions.
Technical Reference
| Component | Details |
|---|---|
| praetorx.queue.job | Concrete model — name, model_name, method_name, record_ids (JSON), state (pending/processing/done/failed), timestamps, error message. Retry and cancel actions. |
| praetorx.validation.mixin | Abstract model — validate_all() returns list of dicts with level/message/field/code. HTML summary with Bootstrap alert classes. Batch validation support. |
| praetorx.batch.mixin | Abstract model — state field (draft/validated/posted/cancelled), 4 workflow actions, 7 validation and processing hooks, computed button visibility, deletion guards. |
| SplitView | OWL component — master-detail layout with configurable widths (default 35%/65%), item selection, scoped slots for master and detail panels. |
| res.config.settings | Extended — praetorx_report_display_mode selection field (download / inline). Stored as system parameter. |
| Cron | Processes pending queue jobs every 1 minute in FIFO order, batch size 100. |
Queue Job Lifecycle
Pending → Processing → Done
Pending → Processing → Failed → (Retry) → Pending
Pending / Processing → (Cancel) → Failed
Oldest pending jobs processed first. Cron runs every minute.
One-click retry resets failed jobs to pending. Error message preserved for debugging.
List view with state badges, form view with JSON editor for record IDs, search with filters and group-by.
Batch Processing Workflow
Draft → Validated → Posted (terminal)
Draft / Validated → Cancelled → Draft (reset)
Override _validate_before_validate(), _validate_before_post(), _validate_before_cancel(), _validate_before_reset() to add custom checks.
Override _post_processing(), _cancel_processing(), _reset_processing() for custom logic after state transitions.
Use Cases
Offload heavy operations (mass invoice posting, document classification, data import) to the queue. Users don’t wait — the cron handles it.
Run multiple validation checks and display the results as a single HTML summary. Errors block, warnings inform.
Draft → Validated → Posted lifecycle for invoices, purchase orders, quality checks. Deletion guards prevent accidental loss of posted records.
Use the SplitView OWL component for email-client-style layouts. Left panel shows a list, right panel shows details. Scoped slots for full template control.
Setup Guide
- Odoo 19.0 (Community or Enterprise)
- Python 3.10+
- Required modules:
base,mail,web - No external Python dependencies
- No external services or API keys
No Enterprise dependency. Works on Community, Enterprise, and Odoo.sh.
Install from the Odoo Apps menu. Search for “PraetorX Base” or “Queue Job”.
PraetorX Base is typically installed automatically as a dependency of other PraetorX modules (Roles, Shell, Cockpit, etc.).
Queue jobs are processed automatically by a cron that runs every minute.
View and manage jobs at PraetorX → Technical → Queue Jobs. By default the list shows pending jobs.
Failed jobs show an error message. Click Retry to re-queue, or Cancel to dismiss.
- Navigate to Settings → PraetorX
- Under PDF Reports, choose Download PDF or Open in Browser Tab
- Click Save
PraetorX / User: Access PraetorX features (subject to module-specific rules). Read-only access to queue jobs.
PraetorX / Manager: Configure PraetorX settings. Implies User.
PraetorX / Administrator: Full control over all PraetorX modules. Implies Manager. Assigned to admin by default.
Add praetorx_base to your module’s depends list, then inherit:
class MyModel(models.Model):
_name = "my.model"
_inherit = ["praetorx.batch.mixin", "praetorx.validation.mixin"]
Override validate_all() for validation rules and use the batch mixin’s workflow actions (action_validate, action_post, etc.) in your form view buttons.
FAQ
base, mail, and web only — all included in Odoo Community. Works on Community, Enterprise, and Odoo.sh.Release History
v19.0.1.1.0 — April 2026
Current Release
- Added shared module categories (PRAETORX / Core) for privilege-based access
- Shared security groups moved here from praetorx_security
- Shared PraetorX root menu and Configuration submenu
v19.0.1.0.0 — Initial Release
Initial Release
- Queue Job System — background processing via cron with state management
- Validation Mixin — structured validation with HTML summaries
- Batch Processing Mixin — state machine for document workflows
- SplitView OWL component — master-detail UI pattern
- PDF Display Mode setting (download vs. inline)
- German translations (de.po)
- 73 automated tests
Modules That Depend on PraetorX Base
Role-based user group management with date-gated assignments and additive sync.
39 EURBranded backend theme with sidebar, home tiles, activity dashboard, and role-based color theming.
FreeEnterprise-grade bidirectional sync between Odoo Documents and SharePoint Online.
349 EURMade with ♥ by Syntax & Sabotage
© 2026 Syntax & Sabotage, Lars Weiler. All rights reserved. LGPL-3.
Impressum · support@syntaxandsabotage.io
Please log in to comment on this module
Quiet, opinionated, and very effective.
PraetorX Base is one of those modules you don’t notice — until you realize everything built on top of it is cleaner, more consistent, and way less painful to maintain.
There are no comments yet!