diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 49fb0cd4614..29e543c157e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -944,7 +944,7 @@ Permission776=Pay expense reports Permission777=Read all expense reports (even those of user not subordinates) Permission778=Create/modify expense reports of everybody Permission779=Export expense reports -Permission1001=Read stocks +Permission1001=Read warehouses and stocks Permission1002=Create/modify warehouses Permission1003=Delete warehouses Permission1004=Read stock movements diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index 0c16e56a898..8b5caae1ed7 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -42,12 +42,6 @@ $langs->loadLangs(array('products', 'stocks', 'orders')); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('stockatdate')); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'produit|service'); - //checks if a product has been ordered $action = GETPOST('action', 'aZ09'); @@ -119,6 +113,14 @@ if ($mode == 'future') { } } +// Security check +if ($user->socid) { + $socid = $user->socid; +} + +$result = restrictedArea($user, 'produit|service'); // Must have permission to read product +$result = restrictedArea($user, 'stock'); // Must have permission to read stock + /* * Actions