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

I have product id and location id in my hand. Is therer any built in function to get quantity on hand of product in that location. Can any one give some small code to get QOH of product in particular location?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Select a product from the refular product list. On the top of the screen under the "More" button, there should be an option "View stock per location" or something similair.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Samba, read the get_product_available method from stock/product.py, it gives you the overview of how to get the quantity of a certain product with various criteria.  Specifically for location, you put in {'location': XXX} into the context when you browse or read the product, then you get the qty_available or virtual_available of the read/browse result.

อวตาร
ละทิ้ง