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

Hi, 

I did a module that sends invoice details to a fiscal device using an api.  I have had issues with getting the invoice data and appending it to the schema.  A gentleman proposed using the ORM Api ( never used it before ).

Are their examples of how the Odoo 10  ORM Api works and more so for the account.invoice module?


Also, kindly check my code and tell me where I am going wrong.

items = []
for line in rec.invoice_line_ids:
invoice_line = {'ID':line.id,'DESC':line.name,'TAXCODE':tax.name,'QTY':line.quantity,'AMT':line.price_unit,'line_total':line.price_subtotal}
items.append(invoice_line)
items = json.dumps(items)

items, predict = [], {}
cashier = self.user_id.name
tsin = self.number
buyername = self.partner_id.name
pinofbuyer = self.partner_id.vat
buyeradd = self.partner_id.city
buyerphone = self.partner_id.phone
for item in self.invoice_line_ids:
items.append({
"name": item.product_id.name,
"quantity"
: item.quantity,
"unitPrice"
: item.price_unit
})




payload_tuples = json.dumps({
"invoiceType": 0,
"transactionType"
: 0,
"cashier"
: cashier,
"TraderSystemInvoiceNumber"
: tsin,
"buyer"
: {
"buyerName": buyername,
"pinOfBuyer"
: pinofbuyer,
"buyerAddress"
: buyeradd,
"buyerPhone"
: buyerphone
},
"items"
: items,
"payment"
: [
{
"amount": 1,
"paymentType"
: "Cash"
}
],
"lines"
: [
{
"lineType": "Text",
"alignment"
: "bold center",
"format"
: "Bold",
"value"
: "Thank you!!"
}
]
})


아바타
취소
관련 게시물 답글 화면 활동
0
3월 25
1136
0
8월 24
1363
1
7월 24
2273
1
3월 22
5032
1
6월 21
3373