Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
2330 Visualizações

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
Cancelar
Autor Melhor resposta
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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
1
set. 17
9241
0
nov. 15
3048
2
dez. 20
2803
1
mar. 15
4723
2
mai. 25
619