Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
2433 Vues

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
Ignorer
Auteur Meilleure réponse
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
Ignorer
Publications associées Réponses Vues Activité
1
sept. 17
9429
0
nov. 15
3170
2
déc. 20
2914
1
mars 15
4806
2
mai 25
793