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()
Hi,
does "order" mean by trying to put "a product" inside a sales order?
Yes it does