Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2335 Zobrazení

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
Zrušit
Autor Nejlepší odpověď
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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
zář 17
9243
0
lis 15
3049
2
pro 20
2808
1
bře 15
4726
2
kvě 25
622