Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4935 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ

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.

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 9 15
4368
3
thg 1 24
13738
3
thg 12 21
15857
23
thg 4 23
48449
0
thg 2 23
4600