From 59ddb6e97f8e029aa9b9415c1a7aa905db296b89 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Sun, 15 Jan 2023 22:25:28 +0100 Subject: [PATCH] Fix : if there is no stock there is an exception instead of a warning --- include/class/stock_goods.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/class/stock_goods.class.php b/include/class/stock_goods.class.php index 1e2d8da7d..668f07985 100644 --- a/include/class/stock_goods.class.php +++ b/include/class/stock_goods.class.php @@ -74,10 +74,10 @@ class Stock_Goods extends Stock_Goods_Sql $motif->size = 80; $idepo = HtmlInput::select_stock($cn, "p_depot", "W"); $idepo->setReadOnly($p_readonly); - if (count($idepo->value) == 0) + if (empty($idepo->value) ) { - NoAccess(); - die(); + echo_warning(_("Aucun stock disponible")); + return; } $idepo->selected = $p_depot; if ($p_readonly ) {