We have the
sale_stock_quantity module to check if the sold products are/will be available in stock. And we have the
stock_supply modules to automatically supply the stock when needed. This works well until there is a delay somewhere in the supply chain (a supplier that does not deliver on time, the production that is blocked etc.).
The only tools we provide for now are:
“Products by Warehouse”: provides an overview of where there could be problem but user need to change the date to see each forecast.
“Product Quantities by Warehouse”: provides a fast way to detect stock level issue for the selected product.
“Stock Moves by Warehouse”: helps to choose which moves of a product to reschedule.
As we can see, we do not help the user finding where are the problems. We provide only tools to analyze the problem.
So we need a tool to spot for the user which shipments or productions have issues with the stock level of the warehouse for their planned date.
We create a new module named
Checking if a shipment or production have enough stock level is an expensive operation and it will be very complex to make a searcher so we propose to have a scheduled task that will loop over each goods. For each good it will search for negative quantity on the warehouse up to the next supply date. For each move in the dates found, it creates an issue grouped per origin and include the move.
On each run the task will mark as solved all the previous non-solved records if possible otherwise it will use the issue to complete with possible new moves.
The user may mark a record as solved to clear it from the list if all the moves linked have a positive quantity.
- origin: Reference of
- planned_date: Computed from the shipment or production
- moves: Many2Many to
- processing_by: the employee who is trying to solve the issue
- solved_by: the employee who marked the issue as solved