From 2c6aeac64f53b8eb88aaf8797975500c01692897 Mon Sep 17 00:00:00 2001 From: Gauthier Date: Thu, 15 Oct 2015 16:48:52 +0200 Subject: [PATCH] FIX : Societe::set_parent() function needs societe object to be fetched to update parent --- htdocs/societe/class/societe.class.php | 1 + htdocs/societe/soc.php | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 7bf8d6c45cf..cd68317c709 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2468,6 +2468,7 @@ class Societe extends CommonObject $resql=$this->db->query($sql); if ($resql) { + $this->parent = $id; return 1; } else diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index be879efecf5..b376a8c2765 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -649,6 +649,7 @@ if (empty($reshook)) // Set parent company if ($action == 'set_thirdparty' && $user->rights->societe->creer) { + $object->fetch($socid); $result = $object->set_parent(GETPOST('editparentcompany','int')); }