Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
3850 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
1
Jan 24
15156
1
Jun 24
29853
1
Mar 18
11385