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:
@@ -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 = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user