Skip to Content
Menu
This question has been flagged
1 Odpoveď
2429 Zobrazenia

I get product.product object using the search method. Now I want to update its quantity in a specific warehouse (I have multiple warehouses) using ORM. how can I achieve it?

Avatar
Zrušiť
Autor Best Answer
stock_loc = self.env['stock.warehouse'].search([('name', '=', wh_name)],
limit=1)
product_quant = self.env['stock.quant'].with_context(inventory_mode=True).create({
'product_id': product.id,
'inventory_quantity': quantity,
'location_id': stock_loc.lot_stock_id.id,
})
Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
1
sep 17
9424
0
nov 15
3169
2
dec 20
2905
1
mar 15
4793
2
máj 25
788