I did it a similar way for my initial import but it did not work.
Here some details about my way:
1.Imported products into product.product and product template with pictures and variations via API and xmlrpc from a csv, which worked fine. I put our internal unique code into the field "default_code" (I guess, like you did)
2.Stock Import: I added my own field to stock_location "x_location" because our coding of shelves is varchar so I cannot use xpos,ypos,zpos
3.Now, I have a second csv file which has: default_code;warehouse_id;x_location;quantity
4.For each product.product I do: SELECT id,default_code,name_template FROM product_product WHERE default_code='CODE FROM ACTUAL CSV ROW'
5.I write by API xmlrpc into stock.location the following fields: comment>'Initialimport', company_id>5, usage>'internal', x_location>'MYOLDLOCATION'
6.I write into stock.move
'product_uos_qty' =>new xmlrpcval($value['product_uos_qty'], "string") ,
'product_uom_qty' =>new xmlrpcval($value['product_uos_qty'], "string") ,
'warehouse_id' =>new xmlrpcval($value['warehouse_id'], "string"),
'state' =>new xmlrpcval('done', "string"),
'name' =>new xmlrpcval($value['name'], "string"),
'product_id' =>new xmlrpcval($row['id'], "string"),
'product_uom' =>new xmlrpcval(1, "string"),
'location_id' =>new xmlrpcval($lid_from, "string"),
'origin' =>new xmlrpcval('Initialimport', "string"),
'location_dest_id' =>new xmlrpcval($rowp['id'], "string")
I don´t see any stock on the products view.
What is missing?
Did you manage it for you?
Thanks Martin