From 722fdaa4eb69aab664774b663c23a4cfc19c26cc Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 17 Dec 2014 15:58:48 +0100 Subject: [PATCH] Fix: check warehouse on product batch Only check warehouse on actions 'create' and 'add' --- htdocs/expedition/card.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 4e795005abb..6ee45778d18 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');