From b6b4189c49f27e82e1c85cf3ab7af6088d36bb04 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 16 Apr 2018 22:23:29 +1000 Subject: [PATCH] UI tweaks --- InvenTree/part/templates/part/part_base.html | 4 +++- InvenTree/stock/models.py | 4 ++++ InvenTree/supplier/templates/supplier/detail.html | 4 ++-- InvenTree/supplier/templates/supplier/partdetail.html | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/InvenTree/part/templates/part/part_base.html b/InvenTree/part/templates/part/part_base.html index 511c1253e3..69840829e3 100644 --- a/InvenTree/part/templates/part/part_base.html +++ b/InvenTree/part/templates/part/part_base.html @@ -42,8 +42,10 @@ Available Stock - {% if part.available_stock == 0 or part.available_stock < part.minimum_stock %} + {% if part.available_stock == 0 %} {{ part.available_stock }} + {% elif part.available_stock < part.minimum_stock %} + {{ part.available_stock }} {% else %} {{ part.available_stock }} {% endif %} diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index 8d0f01a409..d4aac549a5 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -176,6 +176,10 @@ class StockItem(models.Model): part=self.part.name, loc=self.location.name) + @property + def is_trackable(self): + return self.part.trackable + class StockItemTracking(models.Model): """ Stock tracking entry diff --git a/InvenTree/supplier/templates/supplier/detail.html b/InvenTree/supplier/templates/supplier/detail.html index f1c7a8c52a..101446fb95 100644 --- a/InvenTree/supplier/templates/supplier/detail.html +++ b/InvenTree/supplier/templates/supplier/detail.html @@ -44,7 +44,7 @@ SKU Description - Part + Parent Part MPN URL @@ -54,7 +54,7 @@ {{ part.description }} {% if part.part %} - {{ part.part.name }} + {{ part.part.name }} {% endif %} diff --git a/InvenTree/supplier/templates/supplier/partdetail.html b/InvenTree/supplier/templates/supplier/partdetail.html index fce66f5fea..6531195486 100644 --- a/InvenTree/supplier/templates/supplier/partdetail.html +++ b/InvenTree/supplier/templates/supplier/partdetail.html @@ -8,7 +8,7 @@ SKU{{ part.SKU }} Supplier{{ part.supplier.name }} - Part + Parent Part {% if part.part %} {{ part.part.name }}