Merge pull request #23523 from altairis-noe/status_for_inventory_update

FIX: do not let closed inventories reset stock with URL
This commit is contained in:
Laurent Destailleur 2023-01-13 13:22:47 +01:00 committed by GitHub
commit 40e956646d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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