Hi,
does anyone know how to add a new user to some groups?
I' am able to creat a user via API but i don't know how to add the user to Groups and give him access like Sales: Manager and Warehouse: Manager and so on.
To creat a User via API I use the following code:
import xmlrpcliburl = "http://localhost:8069" db = "testDatabase" username = 'admin'password = 'admin'common = xmlrpclib.ServerProxy('{}/xmlrpc/2/common'.format(url))uid = common.authenticate(db, username, password, {})models = xmlrpclib.ServerProxy('{}/xmlrpc/2/object'.format(url))user_id=models.execute_kw(db, uid, password, 'res.users', 'create', [{'name':"userAPI", 'login':'userapi@gmail.com','company_ids':[1], 'company_id':1, 'new_password':'1234567890'}])
Now I want to create the new user and give him access to the Warehouse with the role Manager.
I guess I need to add 'groups_id' to models.execute_kw, but I do not know which value is expected.
I hop, that anyone can halp me.
As you can see in the Tags, i use Odoo Version 8.0-20160119.
Thx Fa