From f5178e9fc36b9c93dc764ceab0c8668ec97cc34a Mon Sep 17 00:00:00 2001 From: Guus Geurkink Date: Tue, 27 Jul 2021 13:06:38 +0200 Subject: [PATCH] Added description as list for StockLocation --- InvenTree/gunicorn.conf.py | 1 + InvenTree/stock/models.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/InvenTree/gunicorn.conf.py b/InvenTree/gunicorn.conf.py index 0e5eee75f9..3eac83ed52 100644 --- a/InvenTree/gunicorn.conf.py +++ b/InvenTree/gunicorn.conf.py @@ -6,3 +6,4 @@ workers = multiprocessing.cpu_count() * 2 + 1 max_requests = 1000 max_requests_jitter = 50 +timeout = 180 diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index ee10bd3ed7..83ba1517c1 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -115,6 +115,13 @@ class StockLocation(InvenTreeTree): """ 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') def before_delete_stock_location(sender, instance, using, **kwargs):