FIX Button receive products not visible

This commit is contained in:
Laurent Destailleur 2018-04-16 11:12:27 +02:00
parent 57c03553dd
commit 0d26bdcdc5
2 changed files with 6 additions and 4 deletions

View File

@ -2176,6 +2176,7 @@ elseif (! empty($object->id))
// modified by hook // modified by hook
if (empty($reshook)) if (empty($reshook))
{ {
$object->fetchObjectLinked(); // Links are used to show or not button, so we load them now.
// Validate // Validate
if ($object->statut == 0 && $num > 0) if ($object->statut == 0 && $num > 0)
@ -2304,11 +2305,11 @@ elseif (! empty($object->id))
// Ship // Ship
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER))
{ {
if (in_array($object->statut, array(3,4))) { if (in_array($object->statut, array(3,4,5))) {
if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->receptionner) { if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->receptionner) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/fourn/commande/dispatch.php?id=' . $object->id . '">' . $langs->trans('OrderDispatch') . '</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/fourn/commande/dispatch.php?id=' . $object->id . '">' . $langs->trans('ReceiveProducts') . '</a></div>';
} else { } else {
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . dol_escape_htmltag($langs->trans("NotAllowed")) . '">' . $langs->trans('OrderDispatch') . '</a></div>'; print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . dol_escape_htmltag($langs->trans("NotAllowed")) . '">' . $langs->trans('ReceiveProducts') . '</a></div>';
} }
} }
} }

View File

@ -200,3 +200,4 @@ RegulateStock=Regulate Stock
ListInventory=List ListInventory=List
StockSupportServices=Stock management support services StockSupportServices=Stock management support services
StockSupportServicesDesc=By default, you can stock only product with type "product". If on, and if module service is on, you can also stock a product with type "service" StockSupportServicesDesc=By default, you can stock only product with type "product". If on, and if module service is on, you can also stock a product with type "service"
ReceiveProducts=Receive products