Merge pull request #3575 from atm-ph/fix_3.8_clone_order

FIX clone customer order
This commit is contained in:
Laurent Destailleur 2015-11-02 11:21:52 +01:00
commit 4cddb0175b

View File

@ -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++;