콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
2985 화면

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!

아바타
취소
관련 게시물 답글 화면 활동
1
11월 21
6175
0
7월 24
4650
0
10월 19
3363
1
11월 18
3167
0
7월 18
4032