Fix: Bug when idprof is mandatory on thrid creation and we use

multicompany
This commit is contained in:
fmarcet 2015-11-26 17:14:03 +01:00
parent 041fa8d3f3
commit 208bf2545f

View File

@ -2348,7 +2348,7 @@ class Societe extends CommonObject
}
//Verify duplicate entries
$sql = "SELECT COUNT(*) as idprof FROM ".MAIN_DB_PREFIX."societe WHERE ".$field." = '".$value."'";
$sql = "SELECT COUNT(*) as idprof FROM ".MAIN_DB_PREFIX."societe WHERE ".$field." = '".$value."' AND entity IN (".getEntity('societe',1).")";
if($socid) $sql .= " AND rowid <> ".$socid;
$resql = $this->db->query($sql);
if ($resql)