Field-Level Permissions
Hide a field, or make it read-only, for the people who should not change it.
Odoo 19.0 Community
What it does
Pick a model and its fields, choose Hidden or Read-only, and choose who it applies to: groups, specific users, or everyone except exempt groups. Odoo enforces the rule on the server, so it also holds for exports and the API.
Features
- Hidden or read-only, for groups, users, or everyone except exempt groups, with optional companies.
- Enforced on the server for reads, searches, exports, filters, sorting, and grouping.
- Conditional read-only: lock a field only on records that match a condition.
- Rules survive upgrades. A missing field marks the rule Broken; the rest keep working.
- Broken-rule checks on install, after upgrades, daily, and on demand.
- View as User shows what someone would see, without signing in as them.
- Audit log of rule changes, and of blocked reads and writes if you turn it on.
- JSON import and export with a dry run.
- Lockout protection: Settings users always bypass, and security fields can't be ruled.
Limits
- Chatter can still show a tracked field's earlier values.
- Portal pages are not covered.
- A report that prints a hidden field shows an access error to that user.
Requirements
- Odoo 19.0 Community. Depends only on base and web.
Need help?
Email support@wolfsaddle.com. WolfSaddle LLC, 5831 Forward Ave #1321, Pittsburgh, PA 15217.
Field-Level Permissions
User guide for Odoo administrators.
Hide a field, or make it read-only, for the people who should not change it. The restriction is enforced by Odoo itself, including on exports and through the API, and it survives an upgrade.
Odoo 19 · Field-Level Permissions 19.0.1.0.4
This guide is for the person who manages users in Odoo. You do not need to write code, and you do not edit views. Every picture was taken in a running Odoo 19 database with the module installed.
The pictures use one company, Northline Furnishings, and three people:
- Avery Cole has Settings, and manages the rules.
- Maya Chen is a salesperson (Sales / User: Own Documents Only). She also has Invoicing, so she can open customer payment terms, and she is allowed to export.
- Jordan Hale is the sales manager (Sales / Administrator). The salesperson rules exclude that group, so Jordan is the “before” picture.
What the module does
Odoo normally decides what a person can do at the level of a whole record: they can open a product, or they cannot. Field-Level Permissions goes one field further.
For a chosen field you can:
- Hide it. It leaves the form, the list, and the export dialog. A read through the API does not return it.
- Make it read-only. The person can see the value and cannot save a change. Odoo refuses the write even if the form is bypassed.
A rule names the field by its technical name, not by a database id. A major upgrade does not delete the rule. If a field really disappears in a later version, the rule is marked Broken and the fields that still exist keep working. Reads do not crash.
Two limits are worth knowing up front:
- A hidden rule with a condition only changes what is on the screen. Leave the condition empty when the value must stay out of exports and the API. The form says this in a warning, and section 4 shows it.
- People with Settings always bypass every rule, so an administrator cannot lock themselves out. Section 10 covers the other protections.
Install it, and where to find it
Field-Level Permissions depends only on the standard Odoo apps. In Apps, clear the Apps filter (this module is an extra module, not its own application), search for Field-Level Permissions, and install Field-Level Permissions.
Field-Level Permissions is installed from Apps
After installation, the tools are under Settings → Users & Companies → Field Permissions:
- Field Rules, the list of rules
- View as User, a simulator
- Audit Log
- Import / Export, for moving rules to another database
Settings, Users and Companies, with Field Permissions open
Only someone with Settings sees that menu. Maya’s app menu has Discuss, Sales, Dashboards, Invoicing, and Apps. There is no Settings, so she cannot create or change a rule.
Maya Chen’s app menu does not include Settings
The first time you open Field Rules, the list is empty. The note on the empty screen is the upgrade promise: rules store technical names, so a major upgrade does not delete them.
The empty Field Rules list
Create a rule
Click New. You get a form with two questions: what to restrict, and who it applies to.
A new field rule, before anything is filled in
Hide product cost from salespeople
On the Office Chair, the sales price is $70 and the cost is $55. Salespeople should quote the price and should not see the cost.
- Name the rule. A clear name helps the audit log later. This one is Hide product cost from salespeople.
- Model: Product. The list shows the label and the technical model, product.template.
- Fields: type the label you know from the form. Choose Cost (Product). That is the cost field, standard_price. Do not choose Cost Currency.
- Mode: Hidden.
- Groups: Sales / User: Own Documents Only.
- Excluded groups: Sales / Administrator.
A sales manager is also a salesperson in Odoo, because Sales / Administrator includes Own Documents Only. The exclusion is what keeps Jordan out of this rule.
The cost rule filled in, not yet saved
Save with the cloud button. The status becomes Valid.
The saved cost rule, status Valid
The product variant has its own cost field. Hiding cost on the product template does not hide that second field, so Northline also has Hide variant cost from salespeople on the model Product Variant. The Apply to related fields button on a rule creates those extra rules for you. It does not copy a condition.
What Maya sees, and what Jordan sees
Signed in as Maya, the Office Chair form shows Sales Price $70.00. There is no Cost field.
Office Chair as Maya Chen: Sales Price is visible and Cost is gone
The same form has no Internal Notes section. That section is a second rule, aimed at Maya alone, and it is covered in section 5.
Maya’s Office Chair form has no Internal Notes section
Signed in as Jordan, Cost is on the form at $55.00, and Internal Notes is there too.
Office Chair as Jordan Hale, with Cost visible
Internal Notes on the Office Chair, visible to Jordan Hale
Make payment terms and the credit limit read-only
Hiding is not always what you want. Maya should see how Acme Corporation pays, and she should not change it.
The rule Lock customer payment terms and credit limit is on the model Contact. The fields are Customer Payment Terms and Credit Limit. The mode is Read-only. The audience is the same salesperson group, again excluding the sales administrator.
The read-only rule for payment terms and credit limit
On Acme Corporation, Maya opens Sales & Purchase. Customer Payment Terms shows 30 Days and the field does not accept a change.
Customer Payment Terms is read-only for Maya Chen
On the Invoicing tab, Credit Limit shows $25,000.00 and is read-only as well. (Credit limits have to be switched on for the company, under Accounting settings, or the field is not on the form for anyone.)
Credit Limit is read-only for Maya Chen
Jordan’s copy of the same field is a normal editable field. The exclusion is doing its job.
Customer Payment Terms is editable for Jordan Hale
Rules that depend on the record
A condition is optional. Empty means the rule always applies. A condition uses the same domain editor as a search filter.
Northline wants the customer reference locked once a quotation becomes a sales order, and editable while it is still a quotation.
The rule Lock customer reference on confirmed orders is on Sales Order, field Customer Reference, mode Read-only, same salesperson audience. Under Condition, click New Rule, choose Status, operator is equal to, value Sales Order.
The domain editor: Status is equal to Sales Order
Save. The form stores the condition and shows how many records match it. In this database that was 21 sales orders. The status stays Valid.
The saved customer-reference rule, with the condition and a match count
Quotation versus confirmed order
Quotation S00001 is still a draft. On Other Info, Maya can edit Customer Reference. It contains PO-4418.
On a quotation, Customer Reference is editable for Maya
Sales order S00007 is confirmed. The same field is read-only and still shows PO-2201. The status badge says Sales Order.
On a confirmed order, Customer Reference is read-only for Maya
Jordan is excluded, so on the same confirmed order he can still edit Customer Reference, and he can see Source Document.
The confirmed order as Jordan Hale: Customer Reference and Source Document are available
Some conditions stay on the server
The domain editor can express “Status is Sales Order”. It cannot express “the salesperson is the current user”, because that condition uses the current user’s id. You can still store that condition. The form then says the domain is not supported, and:
This condition is enforced on the server for read-only rules and is not written into the view.
The field stays editable on the form. Saving a change is what Odoo refuses.
A condition the form editor cannot draw
The rule in the picture is Lock terms and conditions for the current salesperson. It locks the Terms and conditions field on a sales order when Maya is the salesperson. Jordan is excluded.
Groups, people, companies, and turning a rule off
Who has four controls:
| Control | What it does |
|---|---|
| Groups | Everyone in these groups |
| Users | These people, whether or not they are in a group |
| Excluded groups | Not these groups, even if they are also in a targeted group |
| Companies | Only when one of these companies is the active company. Empty means every company. |
| Everyone except exempt | Every user except Settings and the extra exempt group. Do not combine this with groups or users; use exclusions instead. |
You cannot target the Settings group. That group always bypasses field rules, which is the lockout protection in section 10.
Hide internal notes from Maya Chen targets the user Maya Chen, not a group, and the company Northline Furnishings. The field is Description, which is the Internal Notes box on the product form. The mode is Hidden.
A rule for one user and one company
That is why Maya’s Office Chair has no Internal Notes section, and Jordan’s does.
The full list groups the rules by model. Each row shows the mode, whether it applies to everyone except exempt, the state, and an Active switch.
The field rules list, grouped by model
Turn Active off to stop a rule without deleting it. An inactive rule is not enforced. Hide sales description from Maya Chen is switched off in the list below. The other rules stay on.
The Active switch turned off for the sales-description rule
The rule then drops out of the normal list. Search, choose Archived, and it is the one archived rule.
The Archived filter shows the inactive rule
Open it and the form wears an Archived ribbon. Switch Active back on, or unarchive, and the rule applies again.
The archived rule, with the Archived ribbon
View as user
Settings → Users & Companies → Field Permissions → View as User answers “what would this person get?” without signing in as them. Nothing is impersonated. Avery stays Avery.
Choose the user, the company, the model, and optionally a record id. Simulate lists the fields, the mode, the condition, and the rules responsible. For Maya Chen, model Product, record id 5 (the Office Chair), the simulator reports:
- description (Description) — Hidden — Hide internal notes from Maya Chen
- standard_price (Cost) — Hidden — Hide product cost from salespeople
It also lists the views that mention those fields, and related fields that expose the same data. The sales-description rule is absent here because it is archived.
View as User for Maya Chen on the Office Chair
Open form as this user (preview) shows the form architecture that person would receive. It does not open a session as them.
If you pick someone with Settings, the simulator says they bypass field rules and that no field is hidden or locked for them.
The audit log, and what the blocked person sees
Every create, change, and delete of a rule is written to Audit Log. The log cannot be edited.
A blocked save is logged only when Log blocked writes is on (section 10). The line is stored even though Odoo cancels the change.
Maya opens confirmed order S00007, edits Terms and conditions, and clicks save. Odoo shows Access Error:
You cannot change note on 1 Sales Order record(s). A field rule makes them read-only.
note is the technical name of Terms and conditions. The message uses technical names so it stays accurate after a label is translated.
The Access Error Maya sees when she saves Terms and conditions
The same sentence is what a program receives if it writes that field through the API. With logging on, the audit log shows a Blocked row for Maya Chen, field note, rule Lock terms and conditions for the current salesperson, note “Conditional read-only on 1 record(s).” The other rows are Avery’s edits to the rules.
The audit log: rule changes by Avery Cole, and Maya Chen’s blocked save
Exports are protected too
An unconditional Hidden rule removes the field from the export list, because Odoo builds that list from the fields the person is allowed to read.
Maya selects products, chooses Actions → Export, and searches for “cost”. She is offered Cost Currency and Re-Invoice Costs. There is no Cost line.
Maya’s product export dialog has no Cost field
Jordan’s export dialog, on the same screen, includes Cost along with Cost Currency and Re-Invoice Costs.
Jordan’s product export dialog includes Cost
The conditional hidden rule does not do this. Maya’s export of sales orders, searched for “source”, still lists Source Document. That matches the warning on the rule: a condition on a hidden field changes the form only.
Maya can still export Source Document, because that hide rule has a condition
Upgrades, broken rules, and moving rules between databases
Rules are checked when the module is installed, at the end of a module upgrade, and once a day by the scheduled action Field-Level Permissions: validate rules. You can also press Validate all on the Field Rules list.
The check never deletes a rule and never crashes a read. If the model or a field name no longer exists, the rule’s state becomes Broken and a red banner explains why. Fields on that rule that still exist stay enforced.
To show that, the variant-cost rule was given a field name that is not on the product variant, legacy_margin_code, while standard_price was left in place. The banner reads:
Missing field(s) on product.product: legacy_margin_code. Fields that still exist stay enforced.
The status bar says Broken. Cost is still listed, and it is still hidden from salespeople.
A broken rule, with the missing field named in the banner
Validate all confirms the check and leaves the broken rule in place:
Validation finished. Broken rules stay in place and do not crash reads.
The message after Validate all
Put a broken rule back
The missing name is not a tag you can click, because the field is gone. Remove the remaining field tags, add back only the fields you still want (here, Cost), and save. The status returns to Valid, and the stored names are only standard_price.
The variant-cost rule after Cost was added back
Copy rules from staging to production
Import / Export writes every rule as JSON. Models and fields are technical names. Groups are an XML id, or name: followed by the full group name. Users are logins. Companies are company names. Each rule has a technical key.
The dialog says:
Models and fields are technical names (res.partner, email), not database ids. Groups are an XML id, or name:Full Name. Users are logins. The technical key makes a second import update the same rule.
Click Export on a staging database, copy the JSON (or the file field_rules.json), and paste it into the same dialog on production.
Rules exported as JSON
Dry run is on by default. Import then reports what would happen and writes nothing. A second import of the same file updates the existing rules instead of creating duplicates, because the technical key matches. The report below is a dry run: eight rows, each an UPDATE.
A dry-run import report: eight rules would be updated
Turn Dry run off only when the report looks right, then import again. That import writes the rules.
Settings, and why you cannot lock yourself out
Settings → General Settings → Field Permissions has three options.
The Field Permissions settings
Extra exempt group. Users in this group bypass field rules, in addition to Settings. Settings always bypasses, so changing this cannot lock administrators out. Leave it empty unless a second group, such as a support role, should see every field.
Log blocked writes. Off by default. When it is on, a blocked read or write adds an audit-log line. The line is stored even when the blocked change is cancelled. Until you turn it on, a refusal is only recorded in the server log.
Conditional read-only on create. Off by default. A condition then applies to existing records only. Turn it on to also reject a brand-new record whose values already match the condition. The message in that case is: “You cannot set … on a new … that matches a read-only field rule.”
Lockout protection, beyond the Settings bypass:
- Rules cannot target the Settings group, or the extra exempt group.
- Rules cannot be placed on security models (anything technical under ir. or wsfp.), on groups, or on Settings itself.
- On users, the fields that grant access are untouchable: login, password, groups, and the API-key fields.
- Built-in fields the database needs, such as the record id and the display name, cannot be restricted.
- While Odoo is in the middle of installing or upgrading, rules are not applied, so an upgrade can finish.
Questions and fixes
I still see a field I thought I hid. You have Settings, so you bypass every rule. Or you are in an excluded group. Or the rule is archived, the active company is not in the rule’s companies, or the condition does not match this record. View as User shows which rules actually apply.
The salesperson is also a sales manager, and the rule hits both. Sales / Administrator includes Sales / User: Own Documents Only. Put Sales / Administrator in Excluded groups.
A hidden field is still in the export dialog. The rule has a condition. Conditional hidden only changes the form. Clear the condition so the hide is enforced on reads and exports.
A person can edit the field on the form, then gets Access Error on save. The condition could not be drawn into the form (the message under the condition says it is enforced on the server). The save is the enforcement. That is expected for a read-only rule.
After an upgrade a rule says Broken. A technical name on the rule is gone. The banner names it. Fields that still exist stay enforced, and ordinary screens keep opening. Remove the field tags, add back the fields you still want, and save. Validate all checks every rule, including archived ones.
Import created a second copy of a rule. The file had no technical key, or the key did not match. Export from the source database and import that file. A matching technical key updates the existing rule. Run the import with Dry run on first.
The audit log has rule changes and no blocked saves. Log blocked writes is off. Turn it on under General Settings. The line for a refused save is kept even though the save itself is cancelled.
Can I hide a value and still return a mask, such as “•••”? No. Value masking is not in this version. Hidden means the field is absent. Read-only means the real value is visible and cannot be changed.
Will the chatter stop showing a change? Not from this module. If a field is tracked, the chatter can still show the old and new values. The Impact tab on the rule warns you when that is the case.
Does Apply to related fields copy my condition? No. It adds rules for fields on other models that expose the same data, without the condition. Read the note on each new rule. If nothing needs a rule, the button tells you so.
Can a restricted person change the value with a spreadsheet import or a script? A hidden field is not offered in the export list, and a write of a read-only field is refused with the same Access Error as the form. People with Settings, and technical jobs that run with full access inside Odoo, are not restricted.
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