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

How to get customer in account.invoice ?

I have created a button in customer invoice with the following code

.py code

class labelprint(models.Model):

 _inherit = 'account.invoice'

def labeltest(self):

  delivery_partner_id = self.partner_id.()

  url = 'https://requestb.in/1bz11jv1'

  headers = {'Content-Type': 'application/json'}

  data = {

    "Customername" : xxx,

    "Customerphone": xxxx,

  }

  data_json = json.dumps(data)

  r = requests.post(url=url, data=data_json, headers=headers)

what are the function i have to write in xxx in order to get details ?? 

do i have to inherited res.partner ?? 

Please help !!

아바타
취소
베스트 답변

Try,

replace xxx with self.partner_id.name

replace xxxx with self.partner_id.phone

아바타
취소
관련 게시물 답글 화면 활동
0
9월 23
3014
2
8월 25
17401
0
8월 17
5313
1
5월 17
3762
Paypal redirection 해결 완료
2
4월 17
3897