Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
14261 Weergaven

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


Avatar
Annuleer
Beste antwoord

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

   

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
mei 24
1917
3
apr. 23
11320
9
dec. 23
23652
1
mei 20
6131
1
mei 19
2685