Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
5945 Widoki

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!

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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)
Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
sie 24
1298
1
mar 25
1703
1
maj 24
2073
1
lis 22
4266
1
lip 18
5313