UI tweaks

This commit is contained in:
Oliver 2018-04-16 22:23:29 +10:00
parent 118d045e50
commit b6b4189c49
4 changed files with 10 additions and 4 deletions

View File

@ -42,8 +42,10 @@
<tr>
<td>Available Stock</td>
<td>
{% if part.available_stock == 0 or part.available_stock < part.minimum_stock %}
{% if part.available_stock == 0 %}
<span class='label label-danger'>{{ part.available_stock }}</span>
{% elif part.available_stock < part.minimum_stock %}
<span class='label label-warning'>{{ part.available_stock }}</span>
{% else %}
{{ part.available_stock }}
{% endif %}

View File

@ -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

View File

@ -44,7 +44,7 @@
<tr>
<th>SKU</th>
<th>Description</th>
<th>Part</th>
<th>Parent Part</th>
<th>MPN</th>
<th>URL</th>
</tr>
@ -54,7 +54,7 @@
<td>{{ part.description }}</td>
<td>
{% if part.part %}
<a href="{% url 'part-detail' part.part.id %}">{{ part.part.name }}</a>
<a href="{% url 'part-suppliers' part.part.id %}">{{ part.part.name }}</a>
{% endif %}
</td>
<td>

View File

@ -8,7 +8,7 @@
<tr><td>SKU</td><td>{{ part.SKU }}</tr></tr>
<tr><td>Supplier</td><td><a href="{% url 'supplier-detail' part.supplier.id %}">{{ part.supplier.name }}</a></td></tr>
<tr>
<td>Part</td>
<td>Parent Part</td>
<td>
{% if part.part %}
<a href="{% url 'part-suppliers' part.part.id %}">{{ part.part.name }}</a>