Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3773 Vizualizări

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 !!

Imagine profil
Abandonează
Cel mai bun răspuns

Try,

replace xxx with self.partner_id.name

replace xxxx with self.partner_id.phone

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
sept. 23
2819
2
aug. 25
17018
0
aug. 17
5058
1
mai 17
3478
2
apr. 17
3691