diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c1ed2932d70..1df100f1ba5 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -380,9 +380,6 @@ class Societe extends CommonObject dol_syslog(get_class($this)."::Update id=".$id." call_trigger=".$call_trigger." allowmodcodeclient=".$allowmodcodeclient." allowmodcodefournisseur=".$allowmodcodefournisseur); - // For triggers - if ($call_trigger) $this->oldobject = dol_clone($this); - $now=dol_now(); // Clean parameters diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 12f0b0e34a3..54471d6a53a 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -102,7 +102,11 @@ if (empty($reshook)) { require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"); - if ($action == 'update') $object->fetch($socid); + if ($action == 'update') + { + $ret=$object->fetch($socid); + $object->oldcopy=dol_clone($object); + } else $object->canvas=$canvas; if (GETPOST("private") == 1) @@ -317,8 +321,6 @@ if (empty($reshook)) exit; } - $object->oldcopy=dol_clone($object); - // To not set code if third party is not concerned. But if it had values, we keep them. if (empty($object->client) && empty($object->oldcopy->code_client)) $object->code_client=''; if (empty($object->fournisseur)&& empty($object->oldcopy->code_fournisseur)) $object->code_fournisseur='';