Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3188 Vizualizări

Hi, I dont know how to change a group of a user by coding (a function will be called by a button?)

I explored that "self.env.user.has_group('group_name')" will be return True, how can I do with that?

Imagine profil
Abandonează
Autor

Thank you so much

Cel mai bun răspuns

Hi Nedera,

You can add or remove users to/from a group as follows

group = ...your target group...
users = [...a list of users...]

#Add
group.write({'users': [(4, user.id) for user in users]})

#Remove

group.write({'users': [(3, user.id) for user in users]})

For more information see this answer: https://www.odoo.com/forum/help-1/security-60-and-4-in-openerp-89686

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
oct. 22
3264
1
iul. 20
4109
1
iun. 25
1886
3
iul. 25
3488
1
mai 25
1617