Hide units when empty

This commit is contained in:
Oliver Walters 2021-02-12 20:01:09 +11:00
parent b43d6a2ad4
commit b22b82877d
2 changed files with 3 additions and 1 deletions

View File

@ -97,11 +97,13 @@
</a></td> </a></td>
</tr> </tr>
{% endif %} {% endif %}
{% if part.units %}
<tr> <tr>
<td></td> <td></td>
<td><b>{% trans "Units" %}</b></td> <td><b>{% trans "Units" %}</b></td>
<td>{{ part.units }}</td> <td>{{ part.units }}</td>
</tr> </tr>
{% endif %}
{% if part.minimum_stock > 0 %} {% if part.minimum_stock > 0 %}
<tr> <tr>
<td><span class='fas fa-greater-than-equal'></span></td> <td><span class='fas fa-greater-than-equal'></span></td>

View File

@ -119,7 +119,7 @@
<td> <td>
<h4>{% trans "Available Stock" %}</h4> <h4>{% trans "Available Stock" %}</h4>
</td> </td>
<td><h4>{% decimal part.available_stock %} {{ part.units }}</h4></td> <td><h4>{% decimal part.available_stock %}{% if part.units %} {{ part.units }}{% endif %}</h4></td>
</tr> </tr>
<tr> <tr>
<td><span class='fas fa-map-marker-alt'></span></td> <td><span class='fas fa-map-marker-alt'></span></td>