From 0c7cabbf373650f410dfb6203de7284554484f08 Mon Sep 17 00:00:00 2001 From: Drosis Nikos Date: Mon, 6 Oct 2014 16:15:11 +0300 Subject: [PATCH] Fix Error when trying to clone an Order --- htdocs/commande/class/commande.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index a6659ee8bb3..f6d5677af16 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -898,6 +898,13 @@ class Commande extends CommonOrder $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++;