Only stock of active warehouse

I have a problem because I thought that when closing a warehouse, its stock was not taken into account in the calculations of stock, alarms, dispatchable orders, … but it seems that it does take it into account. Is there a way that dolibarr does not take into account the stock of closed warehouses?