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

I want to get the value/amount from a particular location.


I call the stock_value field from product.product model, but it returns the value from overall location, I just want to get the value from a specific loc like if I have two locs Wh/Main and Wh/Extra, I only want to fetch it from extra, how can I do it, I tried the with_context but It has an error comparing apples and oranges.

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

stock valuation using filters, do not solve this?

อวตาร
ละทิ้ง
ผู้เขียน

I tried to use it like product_id.with_context({'location':self.location_id}).stock_value, but it still return the overall so I just use the sm = self.env['stock.move'].search([('location_id','=',self.location_id.id),('product_id','=',product_id.id)]) then a = sum([rec.value for rec in sm]) then I got what I wanted but I dunno if this is a way to do it, Im afraid it will slower the performance

คำตอบที่ดีที่สุด

There is a module here that make this function and its available for all versions 

https://apps.odoo.com/apps/modules/13.0/product_warehouse_quantity/

hope it will help you

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
7
เม.ย. 18
10417
2
ส.ค. 25
540
1
ก.ค. 21
3930
4
ส.ค. 24
14518
2
มี.ค. 23
8688