Added description as list for StockLocation

This commit is contained in:
Guus Geurkink 2021-07-27 13:06:38 +02:00
parent 1dbdcb6d9c
commit f5178e9fc3
2 changed files with 8 additions and 0 deletions

View File

@ -6,3 +6,4 @@ workers = multiprocessing.cpu_count() * 2 + 1
max_requests = 1000 max_requests = 1000
max_requests_jitter = 50 max_requests_jitter = 50
timeout = 180

View File

@ -115,6 +115,13 @@ class StockLocation(InvenTreeTree):
""" """
return self.stock_item_count() return self.stock_item_count()
@property
def description_as_list(self):
""" Simply returns the number of stock items in this location.
Required for tree view serializer.
"""
return self.description.split("-")
@receiver(pre_delete, sender=StockLocation, dispatch_uid='stocklocation_delete_log') @receiver(pre_delete, sender=StockLocation, dispatch_uid='stocklocation_delete_log')
def before_delete_stock_location(sender, instance, using, **kwargs): def before_delete_stock_location(sender, instance, using, **kwargs):