跳至内容
菜单
此问题已终结

Hi,

I can't seem to find any documentation to create a sale order from XML-RPC. This is what I have now :

order = models.execute_kw(db, uid, password, 'sale.order', 'create', [{
'partner_id': 2,
'order_line': [(0, 0, {'product_id':1,'product_uom_qty':2}),
(0, 0, {'product_id':1,'product_uom_qty':2}),
(0, 0, {'product_id':1,'product_uom_qty':2})
]
}])

I don't get any error, printing the order gives me an integer but in Odoo module "Sales" under "Orders" > "Orders", nothing is created...

Thanks for your help!

形象
丢弃
编写者 最佳答案

Hey thanks, for the answer. I don't find any quotation or order. I also tried that but doesn't work either:


order_data = {
'state': 'sale',
'date_order': '2021-04-25',
'user_id': 2,
'partner_id': client_id,
'partner_invoice_id': 1,
'partner_shipping_id': 1,
'picking_policy': 'direct',
'pricelist_id': 1,
'note': 'note',
}

test = models.execute(db, uid, password, 'sale.order', 'create', order_data)
形象
丢弃
最佳答案

Hi Antoine: Since you are not setting the state of the Order it is probably getting created as a Quotation. Both Quotation and Sale Order use the same model - sale.order. Go to Sales > Orders > Quotations, clear out the filter and you should see the quotation you created through xmlrpc.

形象
丢弃
相关帖文 回复 查看 活动
1
8月 24
1568
1
3月 25
1958
1
5月 24
2251
1
11月 22
4551
1
7月 18
5567