Skip to Content
Menú
This question has been flagged
1 Respondre
3841 Vistes

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
Descartar
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
Descartar
Related Posts Respostes Vistes Activitat
1
de gen. 24
15144
1
de juny 24
29820
1
de març 18
11364