2
0
forked from Wavyzz/dolibarr

Add hidden option SUPPLIER_PROPOSAL_AUTOADD_USER_CONTACT (#33524)

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Pierre Ardoin
2025-03-19 19:18:16 +01:00
committed by GitHub
parent f92f159b78
commit c8f38ef97c

View File

@@ -1542,6 +1542,13 @@ class SupplierProposal extends CommonObject
$this->datev = $now;
$this->date_validation = $now;
if (getDolGlobalString('SUPPLIER_PROPOSAL_AUTOADD_USER_CONTACT')) {
$result = $this->add_contact($user->id, 'SALESREPFOLL', 'internal', 1);
if ($result < 0 && $result != -2) { // -2 means already exists
$error++;
}
}
$this->db->commit();
return 1;
} else {