Field Access Rules
Hide a field, or lock it so nobody can change it, for everyone outside the groups you name. Set up from a screen instead of Python, and enforced by the server, not only in the form
Request a live demo · Odoo.sh or On-Premise only, not Odoo Online (SaaS).
2
levels of access: Hidden or Read only
3
kinds of mistake refused when you save a rule
21
automated tests, none failing
1
hook: the check Odoo already uses for every field
base
the only module it depends on
19.0
Odoo version of this build
Field Access Rules is for the person who is asked "can the sales team stop seeing that field?" on an Odoo 19 database, and who knows that deleting a field from a form view settles nothing. You pick a model, tick the fields, name the groups that keep access and choose what everyone else gets: the field is hidden, or it is read only. The rule is fed into the check Odoo itself uses before any field is read or written, so the restriction holds in exports, in searches and over the API as well. This page walks through every step with screenshots of an Odoo 19 database seeded with made-up data, and says plainly where the limits are.
Install it and a Field Access Rules entry appears under Settings, for administrators only. It depends on Odoo's base module and nothing else. The screenshots were taken in an Odoo 19 Community database with the Contacts app installed for the examples: a fictitious office-supply company with one finance user, one dispatch user and one salesperson. The data is synthetic, and every name and number quoted beside a screenshot is read off that screenshot or off the test it came from.
How it works
Why hiding a field in the view is not security
Use it when somebody has asked for a field to be private and you want it private, not just out of sight on one screen.Configures rules, changes no data
The usual answer to "hide this field from the sales team" is to edit the form view. It looks finished. It is not: the field is still in the export dialog, still answers a search filter, and still comes back from a JSON-RPC call to anybody who knows its name. A field removed from a screen is a field the screen no longer mentions, and nothing more.
Odoo does have real field security. A field can carry a list of groups in its Python definition, and users outside them can neither read it nor write it, in any view, export or API call. What Odoo does not give you is a screen for it. To use it you edit the field in code, ship a module, and update. For a field somebody asked about on Tuesday, that is a project.
It is that screen. You choose a model, tick its fields, name the groups that keep access and choose what everybody else gets. The rules are then fed into Odoo's own field-access check, the single place the ORM asks whether this user may touch this field, so a field restricted here is refused by exactly the code that refuses a field restricted in source. There is no second path to remember and patch.
Then it refuses the mistakes you cannot undo from the screen: a rule that would hide the rule screen itself, a rule on the fields the web client reads on every record, and a rule that no active internal user is exempt from. Finally it counts who loses what, so that you find out whether the rule does what you meant before anyone else does.
1 Write a rule: model, fields, groups and access
Use it when you know which field should be private and who should keep it.Saves a rule, enforced at once
Field-level access in Odoo is normally a line of Python on the field, written by a developer and reviewed by nobody who will later ask why it is there. When the CFO asks in March and the auditor asks in October, nothing on screen says who decided what.
The form is one screen in two columns. On the left, the Model and the Fields the rule covers, shown as tags. On the right, Access as two radio buttons, the Groups that keep access as tags, and a Why line for whoever reads the rule in a year. Under them sits one sentence of reminder: everyone outside those groups loses the access in every view, export and API call, not only in the form.
The rule gets a name by itself, built from its access, its first three fields and the model, for example Hidden: partner_latitude, partner_longitude, barcode on res.partner ; a fourth field adds three dots. The list shows every rule with its model, fields, access, groups and reason, and can be filtered by Hidden, Read only or Archived and grouped by model or by access.
The rule list: model, fields, access, the groups that keep it, and why.
A Hidden rule: three fields, one group that keeps them.
A Read only rule: Tax ID stays visible, only Finance Team may change it.
Northfield Office Supply keeps delivery coordinates and gate barcodes on its customers. Only the dispatch team needs them. The administrator opens a new rule on Contact , ticks Barcode , Geo Latitude and Geo Longitude , leaves Access on Hidden, names Dispatch Team as the group that keeps access, and writes Delivery coordinates and gate barcodes: dispatch only . A second rule leaves Tax ID visible but Read only, with Finance Team as the group that keeps the right to change it. Both rules take effect on save: there is no restart, no module update and no developer.
A rule restricts fields on one model. It does not restrict which records a user sees, which is what record rules decide, and it does not change stored values or history. Removing a rule gives the access back and nothing is lost.
a rule written down with its model, fields, groups, access level and reason, enforced from the moment it is saved.
The menu and the rules are for administrators only (Settings). The Administrator user is not exempt from a rule: unless that user is in a group that keeps access, a Hidden field is hidden from it too. The superuser behind scheduled actions and scripts is the only account that is never restricted.



2 Hidden: the field is refused, not merely out of sight
Use it when the people outside the group should not see this value at all.Refused on read, search and write
A hidden column that can still be exported is a leak with a nicer interface. The question to ask of any field restriction is not "can I see it on the form" but "is there still any path by which I can get the value".
For a user outside the groups, a Hidden field is gone. It is not in the list of fields the export dialog offers. It is not in the field list the API answers with. A search that filters on it is refused rather than answered, which matters because a filter you may run is a filter that can recover the value one character at a time. A direct read or write of it is refused with Odoo's standard message, naming the field, the operation and the user. Users inside the groups see no difference at all.
The two screenshots are the same export dialog on the same Contacts list, typed with the same search, Barcode. The first is opened by Daniel Ortiz, in Dispatch Team: the field is offered. The second is opened by Maya Chen, who is not: the same search finds nothing, because as far as her session is concerned the field does not exist.
Dispatch Team: the export dialog offers Barcode.
Everyone else: the same search finds nothing.
With the Dispatch Team rule in place, a call that reads the Barcode of contact 11 as Maya Chen is answered with You do not have enough rights to access the field "barcode" on Contact (res.partner) , with the operation read and her user. The same call as Daniel Ortiz returns GATE-0011 . A search for contacts whose Barcode contains GATE, which Daniel runs and gets six contacts from, is refused for Maya with the same message instead of returning a count. Writes are refused too. The tests behind this cover read, write, search and the field list each on their own, because a restriction that holds on three of those four is not a restriction.
It does not edit view files. A Hidden field drops out of the screens that show it for users outside the groups, and the screen still opens. It also does not erase the value: it stays stored and fully visible to the groups that keep access.
a field that is absent from the export list and refused on read, search and write for everyone outside the groups.
A hidden field drops out of the screens that show it. If a form or list still shows a field you hide here, users outside the groups simply do not see that field on it and the screen still opens: the standard Contact form keeps opening with a hidden field, and the field is gone. The value stays stored and visible to the groups that keep access.


3 Read only: visible, and the server refuses the write
Use it when people may need to see the value but must not change it.Refuses writes on the server
Greying a field out in the form stops the click and nothing else. An import, a script or a hand-made call writes the value anyway, and the person who asked for the lock finds out from the audit trail.
With access set to Read only the field stays visible to everybody and stays readable over the API, and a write by someone outside the groups is refused by the ORM. The form also learns about the restriction: the field is reported as read only to the web client, so it is shown as plain text instead of an edit box that would fail on save. The refusal is the same either way, but one of them is polite.
Finance Team: an editable field (here with the cursor in it).
Everyone else: the same value, with a muted label and no edit box.
The Tax ID of Alder & Finch Stationers, GB 987 6543 21, is on every sales user's screen because they quote with it. After the Read only rule for Finance Team, Priya Nair edits it as before. Maya Chen sees the same number but cannot change it, and a call that writes a new Tax ID as Maya is refused with Odoo's standard field message, with the operation write . The test for this reads the value as an outsider, proves it comes back, then proves the write is refused and that the named group can still write.
It does not keep a history of the field or stop the groups that keep access from changing it. It is a lock on who may write, not a log of who did.
a field everyone can read and only the named groups can change, refused on the server for imports, scripts and API calls as well as in the form.
Read only restricts writing, not reading. If the value itself should be private, use Hidden. A Read only field is reported read only to the web client, so a form that was showing it as an input shows it as text instead.


4 See who it actually affects, before anybody tells you
Use it when you want to check a rule against real people before it does damage.Opens a list, changes nothing
A rule is only as good as the group you named. Choose the wrong one and the people it was meant to protect from still see everything, or the people who need the field lose it on Monday morning. Nobody reports a missing field as a bug at first; they assume the data was never there.
The rule form has a Users this affects button. It opens the list of active internal users who are outside the groups that keep access, which is the list of people who lose something. The number of rows is the number that decides whether the rule does what its author thought. The list is built by finding who is exempt and removing them from the internal users, rather than by asking for the opposite directly, because on a many-to-many group field a direct "not in" does not mean what it reads like and would have listed exempt people too.
People who reach a named group through another group that includes it are counted as exempt, in the list and in the enforcement alike, so the number agrees with what is actually enforced.
The users who lose Barcode, Geo Latitude and Geo Longitude. Daniel Ortiz, in Dispatch Team, is not on it.
The Hidden rule names Dispatch Team. The administrator presses Users this affects and sees the other internal users: the administrator account itself, Maya Chen, Priya Nair and Samuel Okafor. Daniel Ortiz is not in the list. The administrator notices the first line, remembers that the Administrator user is not exempt from a rule, and adds the group to the account before leaving the screen. A test covers the harder case: a user whose group includes Dispatch Team is not in the list, a plain member is not, and a user in neither is.
It lists internal users only. Portal and other external users are not in it, and it does not say which of the fields on a rule each person had been using.
a list of exactly the active internal users who are outside the groups, so a wrong group shows up before a person notices a missing field.
The list is a check at the moment you press the button. It does not watch the group afterwards: adding someone to or removing someone from a group later changes who is affected.

5 It refuses the mistakes you cannot undo
Use it when you would rather the form said no than discover the damage later.Refuses at save
Most configuration mistakes can be reversed from the same screen. A field rule has three that cannot, because they take away the screen you would use to reverse them or the people who could.
Each of the three is refused when you save the rule, with a message that says what is wrong and what to do.
The refusal when the chosen group has no members.
Trying to change the Dispatch Team rule so that its group is Archive Clerks , a group nobody belongs to, is refused with No active internal user is in Archive Clerks, so this rule would take the field away from everybody. Name a group that somebody is actually in. The group is not changed. A rule on the Display Name field of Contact, or on any field of the rule model, is refused in the same way. The check also counts the right people: somebody who holds the named group only through a group that includes it is somebody, so such a rule is accepted.
It does not stop you hiding something people need. It stops you hiding it from everybody. Whether the right people keep it is what the Users this affects list is for.
three irreversible mistakes refused at save, each with a message that names the cause and the fix.
The check runs when the rule is saved or archived or unarchived. It does not run when the last member later leaves the group, so keep an eye on a group that is down to one person.

6 More than one rule, and groups that imply other groups
Use it when several rules touch the same field, or your groups include one another.Resolved the way Odoo would
Real databases have more than one rule per field, from more than one person, and groups that include other groups. A restriction tool that ignores either fails on exactly the people it was meant to exempt.
Two rules on one field combine, and the stricter wins: if one says Hidden and the other Read only, the field is hidden. The groups of the rules on the same field add up, so a user in any of them keeps access.
Groups that include other groups are followed the way Odoo follows them for a field restricted in Python. A user in Finance Manager, a group that includes Finance Team, keeps what Finance Team keeps without being added to it. Reading explicit membership only would have shut the field on the very people the rule exempts, and the affected-users count would have agreed with the mistake, so nothing on screen would have shown it. Tests cover both the enforcement and the count.
Samuel Okafor is in Finance Manager , which includes Finance Team . The Tax ID rule names Finance Team only. Samuel can change a Tax ID without being added to Finance Team, because his group includes it, and he is not on the affected-users list of that rule. Separately, a Read only rule and a Hidden rule on the same field give outsiders a hidden field, not a read only one.
It has no priorities, schedules or per-user exceptions. A rule is a model, some fields, some groups and an access level, and that is the whole language.
the same answer for several rules and for implied groups that Odoo itself would give for a field restricted in source.
Rules are looked up per model and cached. The cache is cleared whenever a rule is created, changed or deleted, so a change takes effect on the next request, with no restart.
7 Switch a rule off, and it is off
Use it when a rule turned out wrong, or the reason for it has gone.Restores access at once
A security rule you cannot remove with confidence is a rule nobody dares touch. The one thing worse than a wrong rule is one that is still enforced after it has been deleted.
Archiving a rule restores access immediately, and so does deleting it. Changing its groups takes effect at once as well. A test for each proves the field is readable again after the rule has gone. The rule screen shows an Archived ribbon on an archived rule, and the list has an Archived filter so you can find what you switched off.
The superuser is never restricted. Scheduled actions, upgrade scripts and database repairs run as the superuser, so a rule cannot wedge the database. The value itself is never touched by any of this: switching a rule off gives back access to what was always stored.
The Dispatch Team rule turns out to hide something the finance team also needed. The administrator archives it from the list. Maya Chen's next read of the Barcode succeeds; nothing was lost, nothing was restored from a backup, and the rule is still in the Archived filter with its reason, ready to be corrected and switched back on.
It keeps no history of rule changes of its own. The Why field and the standard record history are what remain.
archive or delete a rule and the field is readable again on the next request, with the stored values exactly as they were.
Archiving or deleting a rule gives the access back to everyone at once. It does not cancel anything somebody did meanwhile, such as an export taken while the rule was off.
Who it is for
The Odoo administrator who is told a field is private and wants it to be private everywhere, not just on one screen, without writing a module for it.
The consultant who sets up several databases and wants the same field restrictions written down with a reason, in a list, rather than scattered across Python files.
The data-protection lead or the auditor , who asks which fields are restricted, for whom, and why. The rule list answers all three on one screen.
It is not for end users: only administrators can open it. It pairs with the free Field Lock After Approval , which locks fields by the state of the record rather than by who is asking.
What this app does not do
It restricts fields, not records. Which rows a user sees is a different question, and it belongs to record rules.
It does not edit view files. A Hidden field is taken out of every form or list that shows it for the people outside the groups, and those screens still open. The standard Contact form with a hidden field keeps opening; the field is simply gone.
The Administrator user is not exempt. Unless it belongs to a group that keeps access, a Hidden field is hidden from it as well. Only the superuser is never restricted.
The safety check, which refuses a rule nobody is exempt from, runs when the rule is saved. It does not notice when the last member later leaves the group.
It does not change stored data, keep a history of rule changes, or restrict a field per user. A rule is a model, some fields, some groups and an access level.
Questions buyers ask
Is hiding a field here different from removing it from the form?
Yes. Removing a field from a form view leaves it in the export list, in search filters and in API reads. A rule here is checked by the same code that Odoo uses for a field restricted in Python, so reads, writes, searches, exports and the field list all follow it.
Will the form still open if I hide a field that is on it?
Yes. A field hidden by a rule drops out of the screens that show it for users outside the groups, and the screen still opens. On the Contact form the field is simply gone for them.
Does it apply to administrators?
Yes. The Administrator user is not exempt unless it is in a group that keeps access. Only the superuser, used by scheduled actions and scripts, is never restricted.
Which models and fields can I restrict?
Any model and any of its fields, except the rule model itself and the fields the ORM and web client read on every record: id, display name, creator and last editor.
What if I name a group nobody is in?
The rule is refused when you save it, because it would take the field away from everybody. Name a group that at least one active internal user is in.
Do I need to restart Odoo after changing a rule?
No. A change takes effect on the next request.
What happens if I uninstall it?
The restrictions go with the app and every field is available to its usual groups again. The values were never changed.
Does it need developer mode?
No. The screenshots were taken in a normal session.
Requirements
- Odoo 19.0 or 20.0. The App Store sells each version separately, so buy the one that matches your database.
- Odoo.sh or On-Premise only. Third-party apps cannot be installed on Odoo Online (SaaS) databases. Check your hosting before buying.
- Module
mh_field_access_rules, version 19.0.1.0.20, licensed OPL-1.