copy internal and external contacts when cloning like in propal

This commit is contained in:
Christophe Battarel 2019-03-27 10:09:45 +01:00
parent 1b9cdd021a
commit 9efb1b9525

View File

@ -1123,6 +1123,25 @@ class Commande extends CommonOrder
$result=$this->create($user); $result=$this->create($user);
if ($result < 0) $error++; if ($result < 0) $error++;
if (! $error)
{
// copy internal contacts
if ($this->copy_linked_contact($objFrom, 'internal') < 0)
{
$error++;
}
}
if (! $error)
{
// copy external contacts if same company
if ($this->socid == $object->socid)
{
if ($this->copy_linked_contact($objFrom, 'external') < 0)
$error++;
}
}
if (! $error) if (! $error)
{ {
// Hook of thirdparty module // Hook of thirdparty module