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
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Oct 22
|
2042 | ||
|
1
Jul 20
|
2933 | ||
|
2
Dec 24
|
3119 | ||
|
1
Dec 24
|
347 | ||
|
4
Nov 24
|
1364 |
Thank you so much