コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
2443 ビュー

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?

アバター
破棄
著作者 最善の回答
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,
})
アバター
破棄
関連投稿 返信 ビュー 活動
1
9月 17
9462
0
11月 15
3172
2
12月 20
2921
1
3月 15
4832
2
5月 25
800