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

In Sale->sales order->sales person field need to be lock to all the users except admin.how can i do that i.e:Only administrator can select the sales person from the select field

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

Hi,

Following example will make Salesperson field as readonly if logged in user is not admin . You can apply invisible instead of readonly, if you want to make that field invisible. Make following changes in form view of sale.order object

<field name="user_id" attrs="{'readonly': [('user_id','!=',1)]}"/>

Hope this may help you.

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

But admin should select the sales persons from the list but all other users only need to see their own names.Read only option is not applicable here.

You can apply domain where if user is admin, selection field should show all the users, else only display logged in user's name.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 10 20
3374
0
thg 2 25
1458
0
thg 1 25
1217
1
thg 12 24
1606
1
thg 6 22
5783