mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 11:36:44 +00:00
Allow stocktake quantity to be zero (#5644)
- Backport of https://github.com/inventree/InvenTree/pull/5627/ Co-authored-by: Oliver Lippert <oliver@allesit.de>
This commit is contained in:
parent
39e682cd45
commit
fe9a56a5c1
@ -314,10 +314,6 @@ def generate_stocktake_report(**kwargs):
|
|||||||
# Create a new stocktake for this part (do not commit, this will take place later on)
|
# Create a new stocktake for this part (do not commit, this will take place later on)
|
||||||
stocktake = perform_stocktake(p, user, commit=False)
|
stocktake = perform_stocktake(p, user, commit=False)
|
||||||
|
|
||||||
if stocktake.quantity == 0:
|
|
||||||
# Skip rows with zero total quantity
|
|
||||||
continue
|
|
||||||
|
|
||||||
total_parts += 1
|
total_parts += 1
|
||||||
|
|
||||||
stocktake_instances.append(stocktake)
|
stocktake_instances.append(stocktake)
|
||||||
|
@ -2966,7 +2966,7 @@ class PartStocktakeTest(InvenTreeAPITestCase):
|
|||||||
|
|
||||||
data = response.data[0]
|
data = response.data[0]
|
||||||
|
|
||||||
self.assertEqual(data['part_count'], 8)
|
self.assertEqual(data['part_count'], 14)
|
||||||
self.assertEqual(data['user'], None)
|
self.assertEqual(data['user'], None)
|
||||||
self.assertTrue(data['report'].endswith('.csv'))
|
self.assertTrue(data['report'].endswith('.csv'))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user