Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
2446 Visualizzazioni

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
Abbandona
Autore Risposta migliore
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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
set 17
9464
0
nov 15
3172
2
dic 20
2925
1
mar 15
4834
2
mag 25
807