mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-02 03:30:54 +00:00
More test coverage for Stock
This commit is contained in:
@ -53,12 +53,7 @@ class StockLocation(InvenTreeTree):
|
||||
""" Return the number of StockItem objects which live in or under this category
|
||||
"""
|
||||
|
||||
return len(StockItem.objects.filter(location__in=self.getUniqueChildren()))
|
||||
|
||||
@property
|
||||
def item_count(self):
|
||||
|
||||
return self.stock_item_count
|
||||
return StockItem.objects.filter(location__in=self.getUniqueChildren()).count()
|
||||
|
||||
|
||||
@receiver(pre_delete, sender=StockLocation, dispatch_uid='stocklocation_delete_log')
|
||||
@ -444,9 +439,6 @@ class StockItem(models.Model):
|
||||
""" Remove items from stock
|
||||
"""
|
||||
|
||||
if self.quantity == 0:
|
||||
return False
|
||||
|
||||
quantity = int(quantity)
|
||||
|
||||
if quantity <= 0 or self.infinite:
|
||||
|
Reference in New Issue
Block a user