odoo-security-rules
What it does
This tool helps set up who can see and modify information in a system called Odoo. It creates rules to ensure only the right people access the correct data.
When to use it
- βWhen setting up access rights for a new custom module in Odoo.
- βWhen you want users to see only their own data or their company's data.
- βTo fix 'Access Denied' or 'You are not allowed to access' errors.
Skill link
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/odoo-security-rules/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βI need to set up access so regular users can see their own sales orders, but not others'.β
5 new skills a week. 1 minute to read.
How it works
You describe how the access permissions should work. The tool generates the necessary code for Odoo to understand and apply these security rules.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Odoo Security Rules
Overview
Security in Odoo is managed at two levels: model-level access (who can read/write which models) and record-level rules (which records a user can see). This skill helps you write correct ir.model.access.csv entries and ir.rule domain-based record rules.
When to Use This Skill
- Setting up access rights for a new custom module.
- Restricting records so users only see their own data or their company's data.
- Debugging "Access Denied" or "You are not allowed to access" errors.
- Implementing multi-company record visibility rules.
How It Works
- Activate: Mention
@odoo-security-rulesand describe the access scenario. - Generate: Get correct CSV access lines and XML record rules.
- Debug: Paste an access error and get a diagnosis with the fix.
Examples
Example 1: ir.model.access.csv
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_hospital_patient_user,hospital.patient.user,model_hospital_patient,base.group_user,1,0,0,0
access_hospital_patient_manager,hospital.patient.manager,model_hospital_patient,base.group_erp_manager,1,1,1,1
Note: Use
base.group_erp_managerfor ERP managers, notbase.group_systemβ that group is reserved for Odoo's technical superusers. Always create a custom group for module-specific manager roles:<record id="group_hospital_manager" model="res.groups"> <field name="name">Hospital Manager</field> <field name="category_id" ref="base.module_category_hidden"/> </record>
Example 2: Record Rule β Users See Only Their Own Records
<record id="rule_hospital_patient_own" model="ir.rule">
<field name="name">Hospital Patient: Own Records Only</field>
<field name="model_id" ref="model_hospital_patient"/>
<field name="domain_force">[('create_uid', '=', user.id)]</field>
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_unlink" eval="False"/>
</record>
Important: If you omit
<field name="groups">, the rule becomes global and applies to ALL users, including admins. Always assign a group unless you explicitly intend a global restriction.
Example 3: Multi-Company Record Rule
<record id="rule_hospital_patient_company" model="ir.rule">
<field name="name">Hospital Patient: Multi-Company</field>
<field name="model_id" ref="model_hospital_patient"/>
<field name="domain_force">
['|', ('company_id', '=', False),
('company_id', 'in', company_ids)]
</field>
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
</record>
Best Practices
- β Do: Start with the most restrictive access and open up as needed.
- β
Do: Use
company_ids(plural) in multi-company rules β it includes all companies the user belongs to. - β
Do: Test rules using a non-admin user in debug mode β
sudo()bypasses all record rules entirely. - β Do: Create dedicated security groups per module rather than reusing core Odoo groups.
- β Don't: Give
perm_unlink = 1to regular users unless deletion is explicitly required by the business process. - β Don't: Leave
group_idblank inir.model.access.csvunless you intend to grant public (unauthenticated) access. - β Don't: Use
base.group_systemfor module managers β that grants full technical access including server configurations.
Limitations
- Does not cover field-level access control (
ir.model.fieldsread/write restrictions) β those require custom OWL or Python overrides. - Portal and public user access rules have additional nuances not fully covered here; test carefully with
base.group_portal. - Record rules are bypassed by
sudo()β any code running in superuser context ignores allir.ruleentries. - Does not cover row-level security via PostgreSQL (RLS) β Odoo manages all security at the ORM layer.
FAQ
What is `ir.model.access.csv`?
It's a file that defines general permissions for accessing different types of information (models) in Odoo.
What are 'record rules' (`ir.rule`)?
These are more specific rules that define which records (data rows) a user can see or modify, based on conditions like 'belongs to my company' or 'was created by me'.
Why shouldn't I use `base.group_system`?
The `base.group_system` group is for Odoo's technical superusers and grants full access, including sensitive configurations. It's better to create specific groups for module managers.
Details
Original description by the author
Expert in Odoo access control: ir.model.access.csv, record rules (ir.rule), groups, and multi-company security patterns.
Popularity
- GitHub stars
- 48k
- Ranking position
- #5352
- License
- MIT
- Updated
- 10/15/2026
Comments
- β¦
More skills from this repository
00-andruia-consultant
48kHelps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
007
48kLets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
10-andruia-skill-smith
48kHelps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
20-andruia-niche-intelligence
48kLets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.