Add stock-info labels to Part info page

This commit is contained in:
Oliver Walters 2020-03-30 13:37:34 +11:00
parent 06f28898a0
commit 5aec3df7c9
2 changed files with 11 additions and 1 deletions

View File

@ -98,7 +98,7 @@
</tr> </tr>
<tr> <tr>
<td>{% trans "In Stock" %}</td> <td>{% trans "In Stock" %}</td>
<td>{% decimal part.total_stock %}</td> <td>{% include "part/stock_count.html" %}</td>
</tr> </tr>
{% if not part.is_template %} {% if not part.is_template %}
{% if part.allocation_count > 0 %} {% if part.allocation_count > 0 %}

View File

@ -0,0 +1,10 @@
{% load inventree_extras %}
{% load i18n %}
{% decimal part.total_stock %}
{% if part.total_stock == 0 %}
<span class='label label-danger'>{% trans "No Stock" %}</span>
{% elif part.total_stock < part.minimum_stock %}
<span class='label label-warning'>{% trans "Low Stock" %}</span>
{% endif %}