2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-12-16 17:28:11 +00:00

[bug] Stock adjust (#10914)

* Extra checks on backend

* Bug fix for adjustment forms

- Set default quantity of zero

* Additional unit testing (to ensure no regression)
This commit is contained in:
Oliver
2025-11-26 22:32:57 +11:00
committed by GitHub
parent 16b600af88
commit 5713cff1cb
3 changed files with 37 additions and 3 deletions

View File

@@ -1678,6 +1678,10 @@ class StockAddSerializer(StockAdjustmentSerializer):
stock_item = item['pk']
quantity = item['quantity']
if quantity is None or quantity <= 0:
# Ignore in this case - no stock to add
continue
# Optional fields
extra = {}
@@ -1703,6 +1707,10 @@ class StockRemoveSerializer(StockAdjustmentSerializer):
stock_item = item['pk']
quantity = item['quantity']
# Ignore in this case - no stock to remove
if quantity is None or quantity <= 0:
continue
# Optional fields
extra = {}