module delivery_note not exist (no own module descriptor) is global MAIN_SUBMODULE_DELIVERY

This commit is contained in:
Francis Appels 2024-03-12 11:46:12 +01:00
parent 75e99a6dee
commit ba1ca6dc7d
5 changed files with 6 additions and 6 deletions

View file

@ -58,7 +58,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
// Shipment note
if (isModEnabled('delivery_note') && !getDolGlobalString('MAIN_SUBMODULE_EXPEDITION')) {
if (isModEnabled('shipping') && !getDolGlobalString('MAIN_SUBMODULE_EXPEDITION')) {
// This option should always be set to on when module is on.
dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity);
}

View file

@ -3002,7 +3002,7 @@ if ($action == 'create' && $usercancreate) {
// Create shipment
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
if ((getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'creer')) || (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'creer'))) {
$arrayforbutaction[] = array('lang' => 'sendings', 'enabled' => (isModEnabled("delivery_note") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))), 'perm' => $user->hasRight('expedition', 'creer'), 'label' => 'CreateShipment', 'url' => '/expedition/shipment.php?id='.$object->id);
$arrayforbutaction[] = array('lang' => 'sendings', 'enabled' => (isModEnabled("shipping") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))), 'perm' => $user->hasRight('expedition', 'creer'), 'label' => 'CreateShipment', 'url' => '/expedition/shipment.php?id='.$object->id);
/*
if ($user->hasRight('expedition', 'creer')) {
print dolGetButtonAction('', $langs->trans('CreateShipment'), 'default', DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id, '');

View file

@ -4224,7 +4224,7 @@ abstract class CommonObject
} elseif ($objecttype == 'delivery') {
$classpath = 'delivery/class';
$subelement = 'delivery';
$module = 'delivery_note';
$module = 'shipping';
} elseif ($objecttype == 'invoice_supplier' || $objecttype == 'order_supplier') {
$classpath = 'fourn/class';
$module = 'fournisseur';

View file

@ -9191,8 +9191,8 @@ class Form
}
} elseif ($objecttype == 'delivery') {
$tplpath = 'delivery';
if (!isModEnabled('delivery_note')) {
continue; // Do not show if module disabled
if (!getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) {
continue; // Do not show if sub module disabled
}
} elseif ($objecttype == 'ficheinter') {
$tplpath = 'fichinter';

View file

@ -43,7 +43,7 @@ function propal_prepare_head($object)
$h++;
if ((empty($conf->commande->enabled) && ((isModEnabled("shipping") && getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'lire'))
|| (isModEnabled("delivery_note") && getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'lire'))))) {
|| (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'lire'))))) {
$langs->load("sendings");
$text = '';
$head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id;