Skip to Content
Menu
This question has been flagged
1 Atsakyti
2457 Rodiniai

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?

Portretas
Atmesti
Autorius 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,
})
Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
rugs. 17
9483
0
lapkr. 15
3197
2
gruod. 20
2973
1
kov. 15
4842
2
geg. 25
838