Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
1235 มุมมอง
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

When we manufacture, stock quantity is updated automatically; however, if you'd like to update it using code, use the following code.

self.env['stock.quant'].with_context(inventory_mode=True).create({
'product_id': self.product.id,
'inventory_quantity': 2.0,
'location_id': self.stock_location_14.id
}).action_apply_inventory()

Regards

อวตาร
ละทิ้ง