From 272f131b070a82ded90ab8fcb4131cd17070066a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Cendrier?= Date: Thu, 12 Jan 2023 10:18:47 +0100 Subject: [PATCH] do not let closed inventories reset stock with URL --- htdocs/product/inventory/inventory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index fd82300fdda..cbe5d782082 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -118,7 +118,7 @@ if (empty($reshook)) { } // Close inventory by recording the stock movements - if ($action == 'update' && !empty($user->rights->stock->mouvement->creer)) { + if ($action == 'update' && !empty($user->rights->stock->mouvement->creer) && $object->status == $object::STATUS_VALIDATED) { $stockmovment = new MouvementStock($db); $stockmovment->setOrigin($object->element, $object->id);