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

Hello,
Actually i'm working in a project ( i want to update a customer instead of creating it ) 
i did this code but it doesn't work any idea !! 

if record.email:

  contact = env['res.partner'].search([['email', '=', record.email]])


  if contact:

    for c in contact:

      if c.id != record.id :

        records.update({

          'mobile': record.mobile,

          'phone' : '22'

          

        })


아바타
취소
작성자
@Akshay Babu yhanks , but instead of updating the contact .. another conctact created with updated info ... is there any solution ?
베스트 답변

To update an already created customer, you should be updating "c" instead of "records"

if contact:

    for c in contact:

      if c.id != record.id :

        c.write({

          'mobile': record.mobile,

          'phone' : '22'

          

        })


아바타
취소
관련 게시물 답글 화면 활동
4
12월 24
18306
sub-modules odoo sh 해결 완료
1
1월 23
1960
1
5월 24
3395
3
11월 23
17612
3
11월 24
25328