Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3844 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
led 24
15154
1
čvn 24
29841
1
bře 18
11378