diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 3dfdaeb706a..522016edfd9 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1110,7 +1110,7 @@ class Commande extends CommonOrder $result=$product->fetch($fk_product); $product_type=$product->type; - if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER && $product->stock_reel < $qty) { + if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER && $product_type == 0 && $product->stock_reel < $qty) { $this->error=$langs->trans('ErrorStockIsNotEnough'); $this->db->rollback(); return -3; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index f5f526341ff..9e51dfc29ed 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2073,7 +2073,7 @@ class Facture extends CommonInvoice $result=$product->fetch($fk_product); $product_type=$product->type; - if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE && $product->stock_reel < $qty) { + if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE && $product_type == 0 && $product->stock_reel < $qty) { $this->error=$langs->trans('ErrorStockIsNotEnough'); $this->db->rollback(); return -3;