diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 16c889c6e61..cb0e5ccf55e 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -978,6 +978,7 @@ class Commande extends CommonOrder } $this->id=0; + $this->ref = ''; $this->statut=self::STATUS_DRAFT; // Clear fields @@ -986,14 +987,7 @@ class Commande extends CommonOrder $this->date_creation = ''; $this->date_validation = ''; $this->ref_client = ''; - - // Set ref - require_once DOL_DOCUMENT_ROOT ."/core/modules/commande/".$conf->global->COMMANDE_ADDON.'.php'; - $obj = $conf->global->COMMANDE_ADDON; - $modCommande = new $obj; - $this->ref = $modCommande->getNextValue($objsoc,$this); - - + // Create clone $result=$this->create($user); if ($result < 0) $error++;