diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index fcca4cf2f18..8aaf76d310b 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -445,7 +445,7 @@ if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE) - || !empty($conf->mrp->enabled)) { + || isModEnabled('mrp')) { $virtualdiffersfromphysical = 1; // According to increase/decrease stock options, virtual and physical stock may differs. } diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index faf37b62d21..04629b4dee0 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -570,7 +570,7 @@ function show_stats_for_company($product, $socid) } // MO - if (!empty($conf->mrp->enabled) && !empty($user->rights->mrp->read)) { + if (isModEnabled('mrp') && !empty($user->rights->mrp->read)) { $nblines++; $ret = $product->load_stats_mo($socid); if ($ret < 0) { diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 81c27deee76..a7cd6520abb 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -168,7 +168,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (isModEnabled("expedition")) { $nbElements += $project->getElementCount('shipping', 'expedition'); } - if (!empty($conf->mrp->enabled)) { + if (isModEnabled('mrp')) { $nbElements += $project->getElementCount('mrp', 'mrp_mo', 'fk_project'); } if (isModEnabled('deplacement')) { diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index e92a888f21b..c1457a1f4b4 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -159,7 +159,7 @@ if (isModEnabled('holiday')) { if (isModEnabled("banque")) { $langs->load("banks"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'banque', 'test'=>isModEnabled('banque'), 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount"))); } -if (!empty($conf->mrp->enabled)) { +if (isModEnabled('mrp')) { $langs->load("mrp"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'mrp-mo', 'test'=>isModEnabled('mrp'), 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders"))); } if (isModEnabled('recruitment')) { diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 30cf4393d1b..3ef5b5832d4 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5535,7 +5535,7 @@ class Product extends CommonObject } $stock_reception_fournisseur = $this->stats_reception['qty']; } - if (!empty($conf->mrp->enabled)) { + if (isModEnabled('mrp')) { $result = $this->load_stats_inproduction(0, '1,2', 1, $dateofvirtualstock); if ($result < 0) { dol_print_error($this->db, $this->error);