Fix: error with linked element

This commit is contained in:
Regis Houssin 2010-04-30 06:57:28 +00:00
parent 85d7bf3d2b
commit 2a37a9a2fa
2 changed files with 4 additions and 3 deletions

View File

@ -1241,7 +1241,6 @@ class Propal extends CommonObject
// Propale signee
include_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
// TODO move in triggers
$result=$this->create_commande($user);
if ($result >= 0)
@ -1314,7 +1313,6 @@ class Propal extends CommonObject
* \brief Cree une commande a partir de la proposition commerciale
* \param user Utilisateur
* \return int <0 si ko, >=0 si ok
* TODO move in triggers
*/
function create_commande($user)
{

View File

@ -112,6 +112,7 @@ class Commande extends CommonObject
* \brief Cree la commande depuis une propale existante
* \param user Utilisateur qui cree
* \param propale_id id de la propale qui sert de modele
* TODO move in trigger
*/
function create_from_propale($user, $propale_id)
{
@ -158,7 +159,9 @@ class Commande extends CommonObject
$soc = new Societe($this->db);
$soc->id = $this->socid;
$soc->set_as_client();
$this->propale_id = $propal->id;
$this->origin = $propal->element;
$this->origin_id = $propal->id;
return $this->create($user);
}