mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
FIX broken feature, check if module is enabled
This commit is contained in:
parent
b8f094f121
commit
e070a3eda4
|
|
@ -4847,6 +4847,15 @@ abstract class CommonObject
|
|||
$haschild = 0;
|
||||
foreach ($arraytoscan as $table => $element) {
|
||||
//print $id.'-'.$table.'-'.$elementname.'<br>';
|
||||
|
||||
// Check if module is enabled (to avoid error if tables of module not created)
|
||||
if (isset($element['enabled']) && !empty($element['enabled'])) {
|
||||
$enabled = (int) dol_eval($element['enabled'], 1);
|
||||
if (empty($enabled)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if element can be deleted
|
||||
$sql = "SELECT COUNT(*) as nb";
|
||||
$sql .= " FROM ".$this->db->prefix().$table." as c";
|
||||
|
|
|
|||
|
|
@ -87,9 +87,9 @@ class Product extends CommonObject
|
|||
'contratdet' => array('name' => 'Contract', 'parent' => 'contrat', 'parentkey' => 'fk_contrat'),
|
||||
'facture_fourn_det' => array('name' => 'SupplierInvoice', 'parent' => 'facture_fourn', 'parentkey' => 'fk_facture_fourn'),
|
||||
'commande_fournisseurdet' => array('name' => 'SupplierOrder', 'parent' => 'commande_fournisseur', 'parentkey' => 'fk_commande'),
|
||||
'mrp_production' => array('name' => 'Mo', 'parent' => 'mrp_mo', 'parentkey' => 'fk_mo' ),
|
||||
'bom_bom' => array('name' => 'BOM'),
|
||||
'bom_bomline' => array('name' => 'BOMLine', 'parent' => 'bom_bom', 'parentkey' => 'fk_bom'),
|
||||
'mrp_production' => array('name' => 'Mo', 'parent' => 'mrp_mo', 'parentkey' => 'fk_mo', 'enabled' => 'isModEnabled("mrp")'),
|
||||
'bom_bom' => array('name' => 'BOM', 'enabled' => 'isModEnabled("bom")'),
|
||||
'bom_bomline' => array('name' => 'BOMLine', 'parent' => 'bom_bom', 'parentkey' => 'fk_bom', 'enabled' => 'isModEnabled("bom")'),
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user