Fix : if there is no stock there is an exception instead of a warning

This commit is contained in:
sparkyx 2023-01-15 22:25:28 +01:00
parent 1b166ea8cb
commit 59ddb6e97f

View file

@ -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 ) {