From 87fc27c7e649566ebb467dc32af7b65ee623f292 Mon Sep 17 00:00:00 2001
From: jfefe <jf.ferry@aternatik.fr>
Date: Mon, 6 Oct 2014 13:31:01 +0200
Subject: [PATCH] Avoid missing class error for fetch_thirdparty method

---
 htdocs/core/class/commonobject.class.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 6439e3e003e..7c803a0b8a9 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -576,6 +576,9 @@ abstract class CommonObject
 
         if (empty($this->socid)) return 0;
 
+	if (!class_exists('Societe'))
+		require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
+
         $thirdparty = new Societe($this->db);
         $result=$thirdparty->fetch($this->socid);
         $this->client = $thirdparty;  // deprecated
-- 
GitLab