| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Community Apps Dependencies | Show |
| Lines of code | 1297 |
| Technical Name |
praetorx_roles |
| License | OPL-1 |
| Website | https://praetorx.net |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Community Apps Dependencies | Show |
| Lines of code | 1297 |
| Technical Name |
praetorx_roles |
| License | OPL-1 |
| Website | https://praetorx.net |
PraetorX Roles
Role-Based User Group Management with Date-Gated Assignments for Odoo 19
Stop managing individual group memberships. Define roles as named bundles of permissions, assign users to roles with optional date ranges, and let PraetorX Roles handle the rest — including transitive group resolution, additive sync, and automatic expiry via daily cron.
praetorx.net | Syntax & Sabotage
Role Management
Define roles as named collections of Odoo groups. Assign users to roles instead of managing individual group memberships. Update a role’s groups and all assigned users re-sync instantly.
Optional valid-from and valid-until dates per user assignment. Access activates and expires automatically at midnight — no admin intervention required.
Groups outside the role system are never touched. Manually assigned permissions, portal access, and third-party module groups coexist safely alongside role-managed groups.
Full implied-group closure is computed automatically. Assign a parent group to a role and all transitively implied groups are resolved and applied without manual configuration.
Import hundreds of role assignments in seconds. Upload a CSV, preview before applying. Roles are created automatically if they don’t exist, duplicates are skipped with warnings.
A scheduled action runs every night, recomputes date-based activation, and re-syncs all users. Expired assignments lose their groups automatically. New activations applied without admin action.
How the Sync Engine Works
effective_groups = unmanaged_groups ∪ active_role_groups ∪ {base.group_user}
Groups not referenced by any role are never added or removed by the sync.
Transitive group inheritance is included automatically — no manual configuration needed.
Assignment CRUD triggers immediate sync. Daily cron handles date-based activation and expiry.
Technical Reference
| Component | Details |
|---|---|
| praetorx.role | Role definition — name, groups, resolved groups (implied closure), active user count stat button, archive support |
| praetorx.role.line | User assignment — role + user + optional date_from / date_to, computed is_enabled flag |
| praetorx.role.import.wizard | CSV import — columns: role, login, groups (optional), date_from, date_to. Auto-creates roles, skips duplicates |
| res.users | Extended with role_line_ids — shows all role assignments on the user form |
| Cron | Daily sync — recomputes is_enabled for all role lines, re-syncs group memberships system-wide |
Use Cases
Grant warehouse access from Nov 1 to Jan 15 without a reminder to revoke it. The cron handles expiry automatically.
Assign an “Auditor” role scoped to the duration of an engagement. Read-only accounting access, automatically expired.
Pre-configure a new employee’s role assignments before their start date. Access activates on day one.
Use the CSV wizard to reassign 200 users in one operation when departments merge or reorganize.
Screenshots
Role Form — named role with group bundles, resolved groups tab, active user count
Date-Gated Assignments — valid-from / valid-until per user, automatic activation and expiry
CSV Import Wizard — preview table, auto-create roles, skip duplicates
Setup Guide
- Odoo 19.0 (Community or Enterprise)
- Python 3.10+
- Required modules:
base,praetorx_base - 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 Roles” or “Roles”.
Roles requires praetorx_base — this will be installed automatically as a dependency.
- Navigate to Settings → Users & Companies → Roles
- Click New and give the role a name (e.g., “Sales Manager”)
- Select the groups this role should grant
- Check the Resolved Groups tab to see the full implied-group closure
- Click Save
- Open a role and go to the Assignments tab
- Add users with optional Valid From and Valid Until dates
- Groups sync immediately on save
Alternatively, use the CSV Import Wizard (Settings → Users & Companies → Import Roles from CSV) for bulk assignments.
Required columns: role (role name), login (user login).
Optional columns: groups (comma-separated XML IDs), date_from and date_to (YYYY-MM-DD format).
Both UTF-8 and Latin-1 encodings are handled automatically.
User: View roles and assignments (read-only).
Manager: Create and edit roles, manage assignments, run CSV import. Admin user is assigned by default.
FAQ
is_enabled for all role lines and re-syncs group memberships. Expired assignments have their role groups removed at the next cron run. If you need immediate enforcement, trigger a sync manually via the cron action.base and praetorx_base. It has no dependency on any Enterprise-only module and works on both Community and Enterprise.role (role name), login (user login). Optional columns: groups (comma-separated XML IDs to add to the role), date_from and date_to (YYYY-MM-DD format). Both UTF-8 and Latin-1 encodings are handled automatically.res.users. The daily cron processes all role lines in a single batch. There is no observable performance impact at typical user counts (hundreds to thousands).Release History
v19.0.1.1.0 — April 2026
Current Release
- i18n: all source strings converted from German to English
- German translations provided via
i18n/de.po - Geschlechtergerechte Sprache preserved in German translations
v19.0.1.0.0 — March 2026
Initial Release
- Role definitions with named bundles of
res.groups - Date-gated assignments — optional valid-from / valid-until per user
- Automatic group sync on assignment changes
- Full implied-group closure (transitive resolution)
- Additive sync — unmanaged groups never touched
- Daily cron for date-based activation and expiry
- CSV import wizard with preview, auto-create, and duplicate detection
- Resolved groups preview tab on role form
- Active user count stat button with drilldown
- Archive support for roles
- 18 automated tests (CRUD, date logic, sync)
You May Also Like
Branded backend theme with sidebar, home tiles, activity dashboard, and per-role color theming.
FreeReusable technical patterns, shared security groups, and menus for PraetorX modules. Required dependency.
FreeMade with ♥ by Syntax & Sabotage
© 2026 Syntax & Sabotage, Lars Weiler. All rights reserved. OPL-1.
Impressum · support@syntaxandsabotage.io
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