diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 3ab96fed1fa..dd0d4842276 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1111,7 +1111,9 @@ class Expedition extends CommonObject } // Stock control - if (! $error && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > self::STATUS_DRAFT) + if (! $error && $conf->stock->enabled && + (($conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > self::STATUS_DRAFT) || + ($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE && $this->statut == 2))) { require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");