Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
4825 Zobrazení

On the sale.order.line model, I have the field "tax_id", I need this field to readonly for a specific group, but I need to make it happen using odoo only without any code modifications. Is there any possibility for this?

Avatar
Zrušit
Nejlepší odpověď

Hi,

1. Create a New Group (if not already created):
If you haven't already created a group for the specific users who should have read-only access to the "tax_id" field, you can do so by following these steps:

Go to "Settings" > "Users & Companies" > "Groups."
Create a new group (e.g., "Tax Readonly Group").
In the "Access Rights" tab, give the necessary access to the group for the sale.order.line model.

2. Set Field Readonly Access for the Group:
After creating the group, you can set field-level access rights for the "tax_id" field to make it read-only for that group:

Go to "Settings" > "Technical" > "Database Structure" > "Fields."
Search for the "tax_id" field in the list and click on it to open its details.
In the "Access Rights" tab, set the "Readonly" access right to the group you created (e.g., "Tax Readonly Group").

3. Apply Field-Level Security:
Next, you need to apply field-level security to the model. Here's how to do it:

Go to "Settings" > "Technical" > "Security" > "Record Rules."
Create a new record rule.
Define the domain and conditions for the rule. For example, if you want to make the "tax_id" field read-only for specific records, you can define a domain that matches those records.
In the "Technical Features" tab of the record rule, set "Fields: Write" to "false."
In the "Access Rights" tab, assign the rule to the group you created earlier (e.g., "Tax Readonly Group").

By following these steps, you can make the "tax_id" field read only for a specific group without any code modifications in Odoo. Users belonging to that group will have read-only access to the field as defined in the record rule and field-level access rights.


Hope it helps

Avatar
Zrušit

In odoo 17. In the part of..

In the "Access Rights" tab, set the "Readonly" access right to the group you created (e.g., "Tax Readonly Group").

It did have the "Access Rights" tab, but i can't find the "ReadOnly" checkbox.

Related Posts Odpovědi Zobrazení Aktivita
2
zář 15
4287
3
led 24
13554
3
pro 21
15783
23
dub 23
48346
0
úno 23
4551