Display inactive parts in part used_in view

This commit is contained in:
Oliver Walters 2019-07-10 13:18:07 +10:00
parent 322710d603
commit 8637d46981
3 changed files with 9 additions and 2 deletions

View File

@ -53,6 +53,7 @@ class PartBriefSerializer(InvenTreeModelSerializer):
'total_stock',
'available_stock',
'image_url',
'active',
]

View File

@ -36,7 +36,13 @@
field: 'part_detail',
title: 'Part',
formatter: function(value, row, index, field) {
return imageHoverIcon(row.part_detail.image_url) + renderLink(value.full_name, value.url + 'bom/');
var html = imageHoverIcon(row.part_detail.image_url) + renderLink(value.full_name, value.url + 'bom/');
if (!row.part_detail.active) {
html += "<span class='label label-warning' style='float: right;'>INACTIVE</span>";
}
return html;
}
},
{

View File

@ -36,7 +36,7 @@
{% include "hover_image.html" with image=variant.image hover=True %}
<a href="{% url 'part-detail' variant.id %}">{{ variant.full_name }}</a>
{% if not variant.active %}
<span class='label label-warning' style='float: right;'>Inactive</span>
<span class='label label-warning' style='float: right;'>INACTIVE</span>
{% endif %}
</td>
<td>{{ variant.description }}</td>