FIX : Societe::set_parent() function needs societe object to be fetched to update parent

This commit is contained in:
Gauthier 2015-10-15 16:48:52 +02:00
parent e79fe7401f
commit 2c6aeac64f
2 changed files with 2 additions and 0 deletions

View File

@ -2468,6 +2468,7 @@ class Societe extends CommonObject
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
$this->parent = $id;
return 1; return 1;
} }
else else

View File

@ -649,6 +649,7 @@ if (empty($reshook))
// Set parent company // Set parent company
if ($action == 'set_thirdparty' && $user->rights->societe->creer) if ($action == 'set_thirdparty' && $user->rights->societe->creer)
{ {
$object->fetch($socid);
$result = $object->set_parent(GETPOST('editparentcompany','int')); $result = $object->set_parent(GETPOST('editparentcompany','int'));
} }