İçereği Atla
Menü
Bu soru işaretlendi

Hi,


I am currently using the inventory app to create orders using the API, which i can do successfully. But I am unable to add pythons to the orders using the API, as when i try i get no products.


Let me know if you need any more information, i have been stuck on this for a while.


I have included my python code below:

import json
import xmlrpc.client

url = '****'
db = '****'
username = '****'
password = '****'

common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))

uid = common.authenticate(db, username, password, {})

models = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(url))
'''partners = models.execute_kw(db, uid, password,'stock.picking', 'search_read',[[]], {'fields' : [
'location_dest_id',
'location_id',
'move_type',
'picking_type_id',
'product_id',
'move_line_ids',
'move_lines',
'state'
]})
'''
partners = models.execute_kw(db, uid, password,'stock.picking', 'search_read',{})
print(json.dumps(partners,indent=4, sort_keys=True))


def createOrder():
models.execute_kw(db, uid, password,'stock.picking','create',[{
'name': 'TEST4',
'location_dest_id': 5,
'location_id': 8,
'move_type': 'direct',
'picking_type_id': 7,


# Add-ons


'product_id': 2,


'state': 'assigned',
'note': "


"

}])



createOrder()





Avatar
Vazgeç

Hi,
does "order" mean by trying to put "a product" inside a sales order?

Üretici

Yes it does

İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Tem 25
361
1
Eyl 24
3469
0
Şub 23
1175
3
Eki 23
1701
3
Oca 25
2887