ProductQuantitiesByWarehouse is not stable for cache
The query reuse the same ID for today record because it is just using the index order of the list products or templates.
So if in the same transaction we browse ProductQuantitiesByWarehouse with different setup (like stock_quantity_issue
or stock_quantity_early_planning
) we may have the data from a previous record with the same ID but for a different setup (like a different product). This creates wrong computation at least for the two modules previous modules.