diff --git a/htdocs/asset/accountancy_codes.php b/htdocs/asset/accountancy_codes.php index 431b4ba7c68..824f1a75bbb 100644 --- a/htdocs/asset/accountancy_codes.php +++ b/htdocs/asset/accountancy_codes.php @@ -58,7 +58,7 @@ $permissiontoadd = $user->rights->asset->write; // Used by the include of action if ($user->socid > 0) accessforbidden(); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->asset->enabled)) accessforbidden(); +if (!isModEnabled('asset')) accessforbidden(); $result = $assetaccountancycodes->fetchAccountancyCodes($object->id); if ($result < 0) {