Skip to Content
Menú
This question has been flagged
2 Respostes
2697 Vistes

How to Show Forecasted/On Hand quantity of only 1 chosen specific warehouse?

It is showing Total On Hand/Forecasted quantity of all warehouse.

Avatar
Descartar

it seems that this app - https://apps.odoo.com/apps/modules/14.0/product_stock_balance/ - might be useful for your goals

Best Answer

Hi,

Assuming that you have a record set of product and if you need to get the forecasted quantity in a particular WH, you can pass the warehouse id in the context to get the qty from this WH.

Sample:

product_id.with_context(warehouse=2).virtual_available

In the above example, instead of hard coded 2, you can pass the id of your WH dynamically.

Thanks

Avatar
Descartar
Best Answer

Hi

You can write a computation for the qty calculation

@api.depends('location_id')
def _compute_stock_info(self):
"""  Find stock information from the location.  """
warehouses = []
for rec in self.location_id.quant_ids:
    available_quantity = rec.available_quantity
    warehouses.append(available_quantity)

return {
    'warehouses': warehouses
}
Based on this way you can passed the quantity of the particular ware house separatly


Hope it helps

Avatar
Descartar