Generate purchase requests taking into account the storage and input locations stock

I want to generate purchase requests taking into account the storage and input locations stock.
Let’s say that I have the following stock:

product location stock forecast quantity
X Input Zone 0 200
X Storage Zone 20 20
X Other Zone 10 10

I also have created an order point of this product with a min_quantity of 250 units and a target_quantity of 300 so I expect the system to create a purchase request of 80 units but it does not work.
Any help is appreciated.

You must put the input location under the storage location of the warehouse. If you do not want it to be inside the “Storage Zone”, you can create a view to group both and use this one as storage location for the warehouse.

Note that it is strange that there is no future moves that move the product from input zone to the storage zone.

I’ll do some tests. Thanks for the tip.

The incoming moves are created when processing a purchase and future moves from input zone to the storage zone are not created until the shipment is created and received. Is this not the expected workflow?

I think what I said is wrong. I checked again and the generate_requests use the stock level of the full warehouse (stock_skip_warehouse is not set). (FYI: the described behavior above is the one for assignation).

So maybe the planned date for the input moves are outside the supply dates range of the product.
So this would mean that the product are incoming too late to fulfill the order point for the next possible supply date.

Indeed but usually purchases are created from the purchase requests which are taken into account by the supply process.

I think that the problem is not about the planned date for the input moves because the process is takeing into account them but there is no way to specify which locations you want to have into account.

Indeed purchase requests are taken into account by the supply process until them have no purchase line with moves linked.

It takes into account all the location inside the warehouse.

Yes, I know but this is not what I want.
If it sounds strange and nobody has this need I will try to do some customization.
I thought that like the products_by_locataion function, the generate_requests one could also have an argument to specify which locations have to be taken into account.

Well as you did not explain what the system is doing and why you are expecting something else, it is hard to help.

You are right, sorry. I will try to explain the case a bit more.
If i call the generate_request function with forecast=True in the context, it creates a purchase request of 70 units but what I want is to have into account only the incoming moves to the warehouse (input zone) and the storage location so the purchase request should be of 80 units in this case.

You must set the “Other Zone” outside of the warehouse.