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

hello guys, i want to ask a question..

so im using odoo11 and i have 3 groups:

group_a, group_b, group_c


and i want to check the current login user has at least one of them in python? how to do it?

im aware there are self.user_has_groups('group_a) but can i check it more than 1 group?


thanks


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

Hello rehan,


You can check by this way:


if self.env.user.has_group ('group_a') and self.env.user.has_group ('group_b') and self.env.user.has_group ('group_c'):

Your condition

Regards,




Email:     odoo@aktivsoftware.com

Skype: kalpeshmaheshwari

   

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 5 24
1925
3
thg 4 23
11329
9
thg 12 23
23659
1
thg 5 20
6137
1
thg 5 19
2687