Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
9116 Lượt xem

Hello all,

I  have been trying to create a sale order with any item from Odoo, not only items that have already been line items through an API call.

The XML-RPC has been used from the Odoo documentation, but keep getting the error "Item does not exist", even though the item exists in my database.


Can anybody help me, please?   

Ảnh đại diện
Huỷ bỏ

Please share your XML-RPC code.

Câu trả lời hay nhất

def create_sale_order_line(self, order_id, product_id, ttc, discount, discount_price):
if discount == 0:
final_discount_price = ttc
else:
final_discount_price = discount_price
return self.models.execute_kw(self.db, self.uid, self.password,
'sale.order.line', 'create', [{'order_id': order_id, 'product_id': product_id,
'fixed_discount': discount,
'discount_price': final_discount_price,
'price_unit': ttc,
'price_total': ttc,
'company_id': 2,
'discount': 0, }])


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 11 23
299
0
thg 7 21
3715
1
thg 12 15
5961
2
thg 10 24
1306
2
thg 4 24
1267