Community mailing list archives

error accessing wizard via xmlrpc

Chris Jones
- 02/12/2016 15:43:23
I have a custom function that calls the stock serial split function in Manufacturing Order in v7.0. It's sitting in a custom function called via xmlrpc from a mobile app. 

I'm using the following code: 

split_obj = self.pool.get('stock.move.split')

split_wiz_id = split_obj.create(cr, uid, {'product_id': stock_sql_res['product_id'], 'qty': stock_sql_res['product_qty'], 'use_exist': 'True', 'line_exist_ids':{ 'prodlot_id': stock_sql_res['prodlot_id'], quantity: stock_sql_res['product_qty']} }, context )

split_obj.split(cr, uid, [split_wiz_id], context=context)

the stock_sql_res are returned from a select statement. When I run this I get a message that says 

NameError: global name 'quantity' is not defined

line_exist_ids is a many2one field and the fields inside that are prodlot_id and quantity. The prodlot_id and quantity are ultimately going in stock.move and not in stock.move.split but I'm not sure how to feed them in in this query. I know I'm missing something obvious but I'm not sure what it is. 

Chris Jones
Open Source ERP Solutions
Skype: chrishjones20 - Preferred Contact Method