Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2024-09-01 12:47:11 +02:00
commit e2b5725c98
3 changed files with 6 additions and 5 deletions

View file

@ -170,7 +170,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
}
// Correct stock
if ($action == "correct_stock") {
if ($action == "correct_stock" && !$cancel && $usercancreate) {
$product = new Product($db);
if (!empty($product_id)) {
$result = $product->fetch($product_id);
@ -250,7 +250,7 @@ if ($action == "correct_stock") {
}
// Transfer stock from a warehouse to another warehouse
if ($action == "transfert_stock" && !$cancel) {
if ($action == "transfert_stock" && !$cancel && $usercancreate) {
$error = 0;
$product = new Product($db);
if (!empty($product_id)) {

View file

@ -119,6 +119,7 @@ $error = 0;
$usercanread = (($object->type == Product::TYPE_PRODUCT && $user->hasRight('produit', 'lire')) || ($object->type == Product::TYPE_SERVICE && $user->hasRight('service', 'lire')));
$usercancreate = (($object->type == Product::TYPE_PRODUCT && $user->hasRight('produit', 'creer')) || ($object->type == Product::TYPE_SERVICE && $user->hasRight('service', 'creer')));
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('product', 'product_advance', 'read_prices') : $user->hasRight('product', 'lire');
$usercanupdatestock = $user->hasRight('stock', 'mouvement', 'creer');
if ($object->isService()) {
$label = $langs->trans('Service');
@ -247,7 +248,7 @@ if ($action == 'setdesiredstock' && $usercancreate) {
// Correct stock
if ($action == "correct_stock" && !$cancel && $usercancreate) {
if ($action == "correct_stock" && !$cancel && $usercanupdatestock) {
if (!(GETPOSTINT("id_entrepot") > 0)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
$error++;
@ -340,7 +341,7 @@ if ($action == "correct_stock" && !$cancel && $usercancreate) {
}
// Transfer stock from a warehouse to another warehouse
if ($action == "transfert_stock" && !$cancel && $usercancreate) {
if ($action == "transfert_stock" && !$cancel && $usercanupdatestock) {
if (!(GETPOSTINT("id_entrepot") > 0) || !(GETPOSTINT("id_entrepot_destination") > 0)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
$error++;

View file

@ -343,7 +343,7 @@ if ($modulepart == 'barcode') {
$vcffile = '';
if ($reg[1] == 'user') {
$vcffile = $conf->user->dir_temp.'/'.$code;
} elseif ($reg[1] == 'user') {
} elseif ($reg[1] == 'contact') {
$vcffile = $conf->contact->dir_temp.'/'.$code;
}