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

I want to prevent a user/group from editing a Purchase Order based on whether the partner reference field is blank or not. I tried to create a non global record rule with the following domain rule:

[('partner_ref', '=', False)]

applied to create, write and delete. As expected, the user can't create, delete or change a purchase order with a non blank partner reference. But, if the user create a record with a blank partner reference, save it, and then edit, he can save it with a non blank field, which is not what I want. How can I prevent that?

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

Set the permission for particular user or group in ir.model.access.csv under security.

Tác giả

They already have all model access permissions, in addition to those I want to limit based on a specific field value, hence the use of Record Rules.

Câu trả lời hay nhất

Hello,

You can, by view inheritance, hide the partner_ref field for that group, it should work.

Ảnh đại diện
Huỷ bỏ
Tác giả

The field should be visible to the user, but read-only.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 10 20
9230
0
thg 10 19
3999
0
thg 6 16
3346
2
thg 2 16
4747
2
thg 2 25
2247