Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
2979 Представления

Hi i  installed the module membership (specific for associations) ,i am traying to create for each member an account user with default login and password  

Have you any idea?


Аватар
Отменить
Лучший ответ

Soumaya,

You can override the create method of member object and with the creation of each member object, create a new user..

NOTE: tag each user with the member for future references.. (like relation between res_partner and res_users, where res_users is having a many2one to res_partner, same way u can add a many2one field referencing your member object in res_users).

and remember to tag the member with the new user created..as


class res_users:

    member_id = fields.Many2one([member_object])


class [member_class]

def create(self, vals):

            res = super([member_class], self).create(vals)
           # Create your user here and tag res.id(new member created) to it at member_id field.

           return res

Hope it helps!

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
нояб. 21
6172
0
июл. 24
4647
0
окт. 19
3361
1
нояб. 18
3165
0
июл. 18
4030