Allow stocktake quantity to be zero ()

- Backport of https://github.com/inventree/InvenTree/pull/5627/

Co-authored-by: Oliver Lippert <oliver@allesit.de>
This commit is contained in:
Oliver 2023-10-02 22:49:10 +11:00 committed by GitHub
parent 39e682cd45
commit fe9a56a5c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 5 deletions
InvenTree/part

View File

@ -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)
stocktake = perform_stocktake(p, user, commit=False)
if stocktake.quantity == 0:
# Skip rows with zero total quantity
continue
total_parts += 1
stocktake_instances.append(stocktake)

View File

@ -2966,7 +2966,7 @@ class PartStocktakeTest(InvenTreeAPITestCase):
data = response.data[0]
self.assertEqual(data['part_count'], 8)
self.assertEqual(data['part_count'], 14)
self.assertEqual(data['user'], None)
self.assertTrue(data['report'].endswith('.csv'))