Fix no error returned when contact already exists

This commit is contained in:
Laurent Destailleur 2015-02-26 15:52:14 +01:00
parent 22318bb800
commit 8f378b4480

View File

@ -662,7 +662,7 @@ class CommandeFournisseur extends CommonOrder
if (! empty($conf->global->SUPPLIER_ORDER_AUTOADD_USER_CONTACT))
{
$result=$this->add_contact($user->id, 'SALESREPFOLL', 'internal', 1);
if ($result < 0)
if ($result < 0 && $result != -2) // -2 means already exists
{
$error++;
}