Field Readonly By Rule
Configure read-only fields by model with flexible exceptions by user, company, group, or everyone. Add optional conditions and decide whether restrictions apply only to existing records or also during creation.
4
Application modes
2
Readonly scopes
0
Extra business dependencies
13
Automated test cases
Controlled Field Editing Without Custom Views
Field Readonly By Rule gives administrators a practical way to reduce accidental edits on sensitive fields without creating separate inherited views for every model, team, or company. Define the rule once and let Odoo apply it dynamically to the target model views.
- ✓ Protect customer, order, accounting, HR, or custom model fields.
- ✓ Choose exactly who can continue editing protected fields.
- ✓ Apply restrictions to selected fields or every visible field.
- ✓ Keep creation editable by default or lock fields from the first save flow.
Designed for administrators
No developer action is required for day-to-day rule changes. A rule manager can adjust the model, fields, scope, conditions, and exceptions directly from the Odoo interface.
Key Features
Readonly by Model
Select any non-transient model and define which fields should become read-only in form and list views.
Selected or All Fields
Apply a rule to specific fields or protect every field visible in the configured model views.
Conditional Rules
Use a readonly condition to lock fields only when the current record matches a domain-style expression.
Flexible Exceptions
Allow editing by selected users, companies, groups, or apply the restriction to everyone.
Creation Control
Keep creation forms editable by default, or enable the same readonly restriction while users create records.
Manager Bypass
Rule managers are never locked out, so they can always review, correct, or disable a configuration.
Rule Management
Administrators can review active rules from a single list, including the target model, readonly scope, condition, creation behavior, application mode, and active status.
Rule Configuration
Each rule defines the model, the readonly scope, selected fields when needed, the optional condition, and who can still edit those fields.
Readonly Result on Business Records
When a user opens a business record affected by a rule, the configured fields are shown as readonly directly in the native Odoo form. Unprotected fields and normal workflow buttons keep working according to the user's access rights.
Rule Application Modes
| Mode | Behavior |
|---|---|
| Everyone | The configured fields are read-only for all users, except rule managers. |
| Users | Only the selected users can edit the configured fields. |
| Companies | The fields remain editable only in the selected companies. |
| Groups | Only users that belong to the selected groups can edit the configured fields. |
How It Works
Create a readonly rule
Select the target model
Choose selected or all fields
Add condition and exceptions
Open an existing record
Creation-Friendly or Creation-Locked
By default, rules apply when users edit existing records. If a field must also be protected before the first save, enable Apply on Creation on the rule and the same readonly behavior will be applied in creation forms.
Readonly Conditions
Leave the condition as Match all records to protect a field on every record of the selected model, or add a condition when only specific records should be locked.
Supported operators: =, !=, >, >=, <, <=, in, not in.
Configuration Checklist
- Install the module and assign the rule manager group.
- Open Field Readonly Rules from the technical menu.
- Create a rule and select the model to protect.
- Choose Selected Fields or All Fields.
- Add a condition if the rule should only affect matching records.
- Enable Apply on Creation only when new records must start locked.
- Choose Everyone, Users, Companies, or Groups.
Recommended Use Cases
- Prevent accidental changes on validated partner fields.
- Limit editing of commercial fields after record creation.
- Lock fields only when a record reaches a specific status.
- Protect custom model fields without creating extra views.
- Keep company-specific fields editable only in selected companies.
- Allow operational teams to edit only the fields they own.
Frequently Asked Questions
Does it block record creation?
Not by default. Enable Apply on Creation on a rule when the configured fields must also be readonly on new records.
Can I protect all fields of a model?
Yes. Choose All Fields in the readonly scope and the rule will protect every field shown in the model views.
Can I apply a rule to everyone?
Yes. Choose Everyone in the application mode. Only rule managers bypass the readonly behavior.
Does this replace access rights?
No. This is a view-level readonly helper. It does not replace Odoo access rights or record rules.
Important note
This module applies visual restrictions in Odoo views. It does not block backend writes made through imports, RPC calls, automated actions, or custom server-side code.
Please log in to comment on this module