This commit is contained in:
Laurent Destailleur 2021-05-25 12:03:38 +02:00
parent fedf7645b1
commit 857be16e12

View File

@ -3329,6 +3329,8 @@ class Societe extends CommonObject
*/ */
public function setParent($id) public function setParent($id)
{ {
dol_syslog(get_class($this).'::setParent', LOG_DEBUG);
if ($this->id) { if ($this->id) {
// Check if the id we want to add as parent has not already one parent that is the current id we try to update // Check if the id we want to add as parent has not already one parent that is the current id we try to update
if ($id > 0) { if ($id > 0) {
@ -3342,8 +3344,6 @@ class Societe extends CommonObject
} }
} }
dol_syslog(get_class($this).'::setParent', LOG_DEBUG);
$sql = 'UPDATE '.MAIN_DB_PREFIX.'societe SET parent = '.($id > 0 ? $id : 'null').' WHERE rowid = '.((int) $this->id); $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe SET parent = '.($id > 0 ? $id : 'null').' WHERE rowid = '.((int) $this->id);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);