diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 4e795005abb9611d112da04e3de0c6c9359aadda..6ee45778d18dc0ed393688c2c1c4e49dffb7cfb4 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -90,18 +90,20 @@ $hookmanager->initHooks(array('expeditioncard','globalcard')); */ $warehousecanbeselectedlater=1; -if (! empty($conf->productbatch->enabled)) +if (($action == 'create') || ($action == 'add')) { - if (! (GETPOST('entrepot_id','int') > 0)) + if (! empty($conf->productbatch->enabled)) { - $langs->load("errors"); - setEventMessage($langs->trans("WarehouseMustBeSelectedAtFirstStepWhenProductBatchModuleOn"),'errors'); - header("Location: ".DOL_URL_ROOT.'/expedition/shipment.php?id='.$id); - exit; + if (! (GETPOST('entrepot_id','int') > 0)) + { + $langs->load("errors"); + setEventMessage($langs->trans("WarehouseMustBeSelectedAtFirstStepWhenProductBatchModuleOn"),'errors'); + header("Location: ".DOL_URL_ROOT.'/expedition/shipment.php?id='.$id); + exit; + } } } - $parameters=array(); $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');