Hi everyone,
I ran into the following problem and figured I’d share the solution in case someone else needs it too:
The problem
Dolibarr’s replenishment page (Products → Stock → Replenishment) always sums stock across every warehouse in the entity. The same is true for the “current” and “virtual” stock as used pretty much everywhere else in Dolibarr (order line availability checks, TakePOS, shipments, MRP/BOM net-needs, the webservice API, product lists, …). There’s no built-in way to exclude a specific warehouse from that - the “Warehouse” dropdown on the replenishment page only lets you narrow down to a single warehouse, not leave one out of the total.
The example that got me here
We have a demo warehouse (showroom / trade-show units). It holds real, physical stock that keeps getting booked in and out completely normally - receiving, transfers, inventory counts, all as usual. But: those units are permanently tied up as demo/display stock and shouldn’t count as available inventory for general production or sales planning. Without any changes, Dolibarr happily includes the demo warehouse in every availability and reorder calculation - a demo unit can silently mask a real reorder need, or just skew the stock numbers you see everywhere.
The solution
The module adds a simple checkbox to each warehouse: “Exclude from replenishment”. When checked:
-
That warehouse’s stock is no longer counted in reorder suggestions
-
It also stops counting everywhere else in Dolibarr that reads current/virtual stock (order line availability, POS, shipments, MRP net-needs, webservice API, product lists, …)
-
The warehouse itself stays fully usable - it isn’t closed or hidden anywhere, booking stock in/out and inventory counts keep working exactly as before
-
Wherever Dolibarr displays the warehouse’s name, a small “(excluded)” note is appended, so it’s obvious at a glance that this warehouse is left out of stock calculations
Technical note (important before you use this)
For the core piece (stock calculation in Product::load_stock()), Dolibarr core currently has no hook to extend - that required a small, documented patch to product/class/product.class.php (a handful of lines; backup instructions and re-apply steps after a core update are included with the module). For the warehouse-name badge, an existing core hook was enough, no patch needed there.
If you’re going to run this in production, be aware: a Dolibarr core update will silently overwrite the patch, and the exclusion logic will quietly stop working until you re-apply it. Full diff and re-apply instructions are included in the module folder.
- Tested against Dolibarr 22.0.3
- Not an official module, just something I built for our own use case - feedback and suggestions welcome
Cheers!




