تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
2441 أدوات العرض

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
سبتمبر 17
9446
0
نوفمبر 15
3171
2
ديسمبر 20
2915
1
مارس 15
4815
2
مايو 25
797