Revert "Fix: check warehouse on product batch"

This reverts commit a06c5b251e.
This commit is contained in:
Francis Appels 2014-12-17 15:51:12 +01:00
parent a06c5b251e
commit f7d2d0e81f

View File

@ -90,19 +90,18 @@ $hookmanager->initHooks(array('expeditioncard','globalcard'));
*/ */
$warehousecanbeselectedlater=1; $warehousecanbeselectedlater=1;
if ($action == 'create' || $action == 'add') if (! empty($conf->productbatch->enabled))
{ {
if (! empty($conf->productbatch->enabled)) if (! (GETPOST('entrepot_id','int') > 0))
{ {
if (! (GETPOST('entrepot_id','int') > 0)) $langs->load("errors");
{ setEventMessage($langs->trans("WarehouseMustBeSelectedAtFirstStepWhenProductBatchModuleOn"),'errors');
$langs->load("errors"); header("Location: ".DOL_URL_ROOT.'/expedition/shipment.php?id='.$id);
setEventMessage($langs->trans("WarehouseMustBeSelectedAtFirstStepWhenProductBatchModuleOn"),'errors'); exit;
header("Location: ".DOL_URL_ROOT.'/expedition/shipment.php?id='.$id);
exit;
}
} }
} }
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');