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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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?
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
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj się| Powiązane posty | Odpowiedzi | Widoki | Czynność | |
|---|---|---|---|---|
|
1
paź 22
|
4056 | |||
|
1
lip 20
|
4751 | |||
|
2
paź 25
|
3205 | |||
|
1
wrz 25
|
3142 | |||
|
3
lip 25
|
4434 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.
Thank you so much