diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 70f06169394..4f2b58ff00d 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -221,7 +221,7 @@ class modCommande extends DolibarrModules // Add multicompany field if (!empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED)) { $nbofallowedentities = count(explode(',', getEntity('commande'))); - if (!empty($conf->multicompany->enabled) && $nbofallowedentities > 1) { + if (isModEnabled('multicompany') && $nbofallowedentities > 1) { $this->export_fields_array[$r]['c.entity'] = 'Entity'; } }