Material request that is aware of current warehouse levels?

I am new to ERPNext and still trying to understand the proper workflows. Say we have 10 apples and 3 beets in our Warehouse A. A sales order comes in for 8 apples and 6 beets. Assuming I need the items in Warehouse B to fulfill the sales order, how do I quickly create a material request (for the 8 apples from A->B) and purchase order (for the 6 beets I need to purchase from a supplier)?

Or am I thinking of this wrong?

There’s provision for automated material requests based on defined reorder level. Please go through the stocks/warehousing section in the manual.

I read that section and watched all the videos and played around with the platform before posting. But auto-reorder doesn’t solve my needs as we primarily do just-in-time fulfillment (like purchase-to-order). So we bring in product based on sales orders, but there is also some leftover stock sometimes so we want to not over-order. We don’t want to auto-reorder but rather have some way to easily generate a material request/purchase order for 300 products taking sales order numbers minus current stock.

Did you ever find a solution to this? The closest I’ve been able to figure out is to create a material request from sales orders and then to use a custom script that reduces each line in the material request by current stock.

We do just in time. I think to do it right, that is to truly minimise the stock you hold, you have to manually review quantities.

But I think what your asking about can be done, I do it for some products. Set the auto reorder quantity to zero and the level to one, this will create material requests for the right quantity to fill all sales orders without over ordering.

I also created a hook that alters the frequency of auto material requests generation from each day to every three minutes. I didn’t even need to write code, I followed the instructions to create a custom app which generates the file and when I opened that I found that the Devs had anticipated my needs, the code was already there, just commented out.

1 Like

Thanks for this tip! I’ll give this a shot and see how it goes. I had read about the 0 qty → 1 reorder thing, but the way you’ve framed it here helped me think about the right approach a bit differently.

I agree that some extent of manual review is necessary, but if we can auto-reorder like this it makes the manual work much simpler.