Skip to Content
Menu
This question has been flagged
1 Reply
3118 Views

Hi,


I am Lisa, I want to enter a quantity to my product with python2 (odoo version 11).


I use this code:


push_quantity = models.execute_kw(db, uid, password, 'stock.change.product.qty', 'create', [{

'new_quantity': float(1.0), 'product_id': '300', 'lot_id': "495", 'location_id': "12"
}])
print('myquantity', push_quantity)

the var 'myquantity' have an id but I haven' t an update of my quantity.

Could you help me please?


Thank you,

Lisa

Avatar
Discard
Best Answer

Hi Lisa,

To get reflect the updated product quantity you need to call method 'change_product_qty' after creating the record of stock.change.product.qty object.

push_quantity = models.execute_kw(db, uid, password, 'stock.change.product.qty', 'create', [{

'new_quantity': float(1.0), 'product_id': '300', 'lot_id': "495", 'location_id': "12"

}])

models.execute_kw(db, uid, password, 'stock.change.product.qty', 'change_product_qty', [[push_quantity]])

Hope this may help you!

Thanks

Regards,




Email:      odoo@aktivsoftware.com  

Skype: kalpeshmaheshwari

   

Avatar
Discard
Related Posts Replies Views Activity
1
Jan 24
14476
1
Jun 24
25120
1
Mar 18
10494