Odoo Studio makes it easy to limit access to specific fields on a Form View.
For this example we’ll limit access to the product cost field
Enable Odoo Studio, click on the “Cost” field and properties are shown in the left-hand panel.
In the bottom left there is the field “Limit Visibility to groups”
For this example, we’ll only allow Sales Managers to see the cost.
- Of course you can select another group, or multiple groups.
- One limitation is that if you create a group through the Odoo UI you won’t be able to use it here (as it doesn’t have an External ID).
That’s all you need to do.
But do remember that this limitation only applies to this Form View, and the user might be able to see the same field on another View (or by downloading data to Excel / CSV).
Technical Notes
Behind the scenes, Odoo Studio creates an Extension View.
We can see this by enabling developer mode and navigating to Settings / Technical / Views. Search for views with “Studio” in the name and for the product.template
model
This is an Extension View, and it inherits the product.template.product.form
view. It’s a Form View for the product.template
model
Architecture (XML)
<data> <xpath expr="//field[@name='standard_price']" position="attributes"> <attribute name="groups">sales_team.group_sale_manager</attribute> </xpath> </data>
sales_team.group_sale_manager
is the Sales / Manager user access group.
Without Studio you could create an Extension View to do the same thing.
Hey, you can also modify only base view. For instance: Is it equivalent of this you described above? Thanks for tip
LikeLike
Of course you can modify the Base View. It’s simpler and quicker but you need to think what will happen if you apply upgrades.
LikeLike
Hi
we only and always use odoo studio. Have you tried upgrading your odoo instance? have you kept your odoo studio changes?
LikeLike
No – Odoo are supposed to upgrade changes that were made in Studio, but it seems that it’s not always done correctly.
LikeLike
when trying this in Odoo Studio I get the following error message: “Only groups with an external ID can be used here”.
LikeLike
I added an explanation – if you create a new user access group through the UI you will not be able to use it here.
LikeLike
Hi, Great site and very helpful!!
I have a nut I’m trying to crack, in a multi-company environment is it possible to make some field visible depending on the company you are logged in as using Studio, I’ve tried any combination I can think of and can’t seem to make it work,
For example on the contact form we have certain fields that should only be viewed by users of company A and other files that should only viewed by company B, these are different fields completely not different values for the same field.. thoughts?
LikeLike
Limit access to the Employee Chatter Is possible ? In studio, is not a field, and i can´t set “limit visibility to groups”
I want employees can only see their own chatter.
LikeLike
Hello,
I have a similar question. I have a field (unit price) that I made read only (so Sales reps do not change pricing). But I need the ability to have our VP of Sales modify this field as necessary. Basically, having this field as read only to everyone except 1 person (internal user).
Any thoughts how I can tackle this?
LikeLike
Hello,
How do you restrict users from changing the price on the sale order line?
With studio if I put it as a read only, then no price appears at all.
LikeLike