2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 11:10:54 +00:00

Null units fix (#3663)

* Hide units on part page if units are null

* Hide null units in stock table

* Hide null units in supplier part table

* Hide null units in part tables

* Template cleanup

* Unit test fix
This commit is contained in:
Oliver
2022-09-08 15:18:43 +10:00
committed by GitHub
parent b827f14bf6
commit 875dda7e59
10 changed files with 22 additions and 23 deletions

View File

@ -348,7 +348,7 @@
<h5>{% trans "Available Quantity" %}</h5>
</td>
<td>
<h5>{% if item.quantity != available %}{% decimal available %} / {% endif %}{% decimal item.quantity %} {% if item.part.units %}{{ item.part.units }}{% endif %}</h5>
<h5>{% if item.quantity != available %}{% decimal available %} / {% endif %}{% decimal item.quantity %} {% include "part/part_units.html" with part=item.part %}</h5>
</td>
{% endif %}
</tr>

View File

@ -49,7 +49,7 @@ class StockDetailTest(StockViewTestCase):
# Quantity
self.assertIn('<h5>Available Quantity</h5>', html)
self.assertIn('<h5>4000 </h5>', html)
self.assertIn('<h5>4000', html)
# Batch code
self.assertIn('Batch', html)