Limiting access to fields (Odoo Studio)

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.

That’s all you need to do.

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 role.

Without Studio you could create an Extension View to do the same thing.

10 thoughts on “Limiting access to fields (Odoo Studio)

  1. Hej, you can also modify only base view. For instance: Is it equivalent of this you described above? Thanks for tip

    Like

  2. 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.

    Like

      1. No, but my understanding is that Odoo will upgrade changes that were made in Studio.

        Like

  3. when trying this in Odoo Studio I get the following error message: “Only groups with an external ID can be used here”.

    Like

  4. 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?

    Like

  5. 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.

    Like

  6. 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?

    Like

  7. 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.

    Like

Leave a Reply to Mario Molinos Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s