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

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
Descartar
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
Descartar
Related Posts Respostes Vistes Activitat
1
de set. 17
9310
0
de nov. 15
3093
2
de des. 20
2873
1
de març 15
4757
2
de maig 25
713