Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
2456 Weergaven

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
Annuleer
Auteur Beste antwoord
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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
sep. 17
9483
0
nov. 15
3196
2
dec. 20
2973
1
mrt. 15
4842
2
mei 25
837