Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
3616 Переглядів

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
вер. 23
2712
2
лип. 25
16770
0
серп. 17
4911
1
трав. 17
3306
Paypal redirection Вирішено
2
квіт. 17
3566