Hi,
I use the "auth_ldap" module that allows you to sync users between an LDAP server and Odoo.
I override the method to create the user to retrieve more informations like email or company.
The problem is that I use the multicompany feature and I can not associate multiple companies to an user.
I tried something like that but it does not work:
class Users(object):
def __init__(self, name, company_id, company_ids, login, email):
self.login = login
self.company_id = company_id
self.company_ids = company_ids
self.login = login
self.email = email
values = Users("Test TEST", 1, [1, 2, 3], "test.test", "test.test@test.fr")
self.env['res.users'].sudo().create(values)
Do you know how can I associate multiple companies to an user when it's created?
Best regards,
Robin Hède.