diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index adcde4b0d5e..ed3b26e04ac 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -488,7 +488,7 @@ class Thirdparties extends DolibarrApi if( ! DolibarrApi::_checkAccessToResource('societe', $this->company->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - $this->company->oldcopy = $this->company; + $this->company->oldcopy = clone $this->company; return $this->company->delete($id); }