do not let closed inventories reset stock with URL

This commit is contained in:
Noé Cendrier 2023-01-12 10:18:47 +01:00
parent a9c8c24e9b
commit 272f131b07

View File

@ -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);