Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
3845 Vistas

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
Mejor respuesta

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
Publicaciones relacionadas Respuestas Vistas Actividad
1
ene 24
15156
1
jun 24
29845
1
mar 18
11379