Fix: error with linked element
This commit is contained in:
parent
85d7bf3d2b
commit
2a37a9a2fa
@ -1241,7 +1241,6 @@ class Propal extends CommonObject
|
|||||||
// Propale signee
|
// Propale signee
|
||||||
include_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
include_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
||||||
|
|
||||||
// TODO move in triggers
|
|
||||||
$result=$this->create_commande($user);
|
$result=$this->create_commande($user);
|
||||||
|
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
@ -1314,7 +1313,6 @@ class Propal extends CommonObject
|
|||||||
* \brief Cree une commande a partir de la proposition commerciale
|
* \brief Cree une commande a partir de la proposition commerciale
|
||||||
* \param user Utilisateur
|
* \param user Utilisateur
|
||||||
* \return int <0 si ko, >=0 si ok
|
* \return int <0 si ko, >=0 si ok
|
||||||
* TODO move in triggers
|
|
||||||
*/
|
*/
|
||||||
function create_commande($user)
|
function create_commande($user)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -112,6 +112,7 @@ class Commande extends CommonObject
|
|||||||
* \brief Cree la commande depuis une propale existante
|
* \brief Cree la commande depuis une propale existante
|
||||||
* \param user Utilisateur qui cree
|
* \param user Utilisateur qui cree
|
||||||
* \param propale_id id de la propale qui sert de modele
|
* \param propale_id id de la propale qui sert de modele
|
||||||
|
* TODO move in trigger
|
||||||
*/
|
*/
|
||||||
function create_from_propale($user, $propale_id)
|
function create_from_propale($user, $propale_id)
|
||||||
{
|
{
|
||||||
@ -158,7 +159,9 @@ class Commande extends CommonObject
|
|||||||
$soc = new Societe($this->db);
|
$soc = new Societe($this->db);
|
||||||
$soc->id = $this->socid;
|
$soc->id = $this->socid;
|
||||||
$soc->set_as_client();
|
$soc->set_as_client();
|
||||||
$this->propale_id = $propal->id;
|
|
||||||
|
$this->origin = $propal->element;
|
||||||
|
$this->origin_id = $propal->id;
|
||||||
|
|
||||||
return $this->create($user);
|
return $this->create($user);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user