copy internal and external contacts when cloning like in propal
This commit is contained in:
parent
1b9cdd021a
commit
9efb1b9525
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user