From 6a6873ff737639abc40b09e97bebfbed111fa2d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Sat, 30 Mar 2024 19:11:29 +0100 Subject: [PATCH] Update replenish.php php error warning --- htdocs/product/stock/replenish.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index e83e505f3e0..53a0b5060e7 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -845,7 +845,9 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } } else { $stock = $prod->stock_reel; - $stockwarehouse = $prod->stock_warehouse[$fk_entrepot]->real; + if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) { + $stockwarehouse = $prod->stock_warehouse[$fk_entrepot]->real; + } } // Force call prod->load_stats_xxx to choose status to count (otherwise it is loaded by load_stock function)