Community mailing list archives

community@mail.odoo.com

Re: error accessing wizard via xmlrpc

by
Vauxoo S.A. de C.V., Julio Serna
- 02/12/2016 15:53:25
Hello

quantity should be 'quantity'

Like this,
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 )




2016-02-12 14:47 GMT-06:00 Chris Jones <chris.jones@saasier.com>:
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
SaaSier.com
Open Source ERP Solutions
310-400-0256
Skype: chrishjones20 - Preferred Contact Method

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--
Julio Serna
Vauxoo