Merge pull request #8471 from atm-ph/fix_6.0_error_creating_soc

Fix error on creating company with external module in 'custom' folder…
This commit is contained in:
Laurent Destailleur 2018-03-29 13:48:36 +02:00 committed by GitHub
commit 39758625b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2511,21 +2511,16 @@ class Societe extends CommonObject
if (! empty($conf->global->SOCIETE_CODECOMPTA_ADDON))
{
$file='';
$res=false;
$dirsociete=array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']);
foreach ($dirsociete as $dirroot)
{
if (file_exists(DOL_DOCUMENT_ROOT.'/'.$dirroot.$conf->global->SOCIETE_CODECOMPTA_ADDON.".php"))
{
$file=$dirroot.$conf->global->SOCIETE_CODECOMPTA_ADDON.".php";
break;
}
$res=dol_include_once($dirroot.$conf->global->SOCIETE_CODECOMPTA_ADDON.'.php');
if ($res) break;
}
if (! empty($file))
if ($res)
{
dol_include_once($file);
$classname = $conf->global->SOCIETE_CODECOMPTA_ADDON;
$mod = new $classname;