Fix error on creating company with external module in 'custom' folder with a file to generate accountancy code
This commit is contained in:
parent
1c581c6fff
commit
a89983ef5c
@ -2515,17 +2515,12 @@ class Societe extends CommonObject
|
||||
$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;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user