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

Hi all, is there a way to create a user from a contact without installing the mail odoo app ? Because I want to have this feature in my odoo integration but I don't want a mail service in it, for example coding something or maybe editing a module.

아바타
취소
작성자 베스트 답변

thanks for the help, but im trying this code and its not creating new users i dont know why?

아바타
취소
베스트 답변

Hi,

If you are familiar with code you can achieve this by over riding the create function of model res.partner, super it and create the user.

class ResPartner(models.Model):
_name = 'res.partner'
_inherit = 'res.partner'

@api.model
def create(self, vals):
res = super(ResPartner, self).create(vals)
for rec in res:
user = self.env[‘res.users’].sudo().create({
‘name’: rec.name,
‘login’: rec.email,
‘partner_id’: rec.id
)}
return res

Regards

아바타
취소
관련 게시물 답글 화면 활동
1
8월 25
1741
0
10월 24
1373
0
11월 23
1847
1
8월 22
2617
0
8월 22
2147