mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Part BOM list now shows how many of each sub-item are available
- If there are enough to build the available quantity is shown in green - Otherwise, shown in orange
This commit is contained in:
parent
8a3706dd76
commit
2d21bf0626
@ -32,6 +32,7 @@ class PartBriefSerializer(serializers.ModelSerializer):
|
||||
'url',
|
||||
'name',
|
||||
'description',
|
||||
'available_stock',
|
||||
]
|
||||
|
||||
|
||||
|
@ -85,10 +85,29 @@
|
||||
},
|
||||
{
|
||||
field: 'quantity',
|
||||
title: 'Quantity',
|
||||
title: 'Required',
|
||||
searchable: false,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'sub_part.available_stock',
|
||||
title: 'Available',
|
||||
searchable: false,
|
||||
sortable: true,
|
||||
formatter: function(value, row, index, field) {
|
||||
var text = "";
|
||||
if (row.quantity < row.sub_part.available_stock)
|
||||
{
|
||||
text = "<span class='label label-success'>" + value + "</span>";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "<span class='label label-warning'>" + value + "</span>";
|
||||
}
|
||||
|
||||
return renderLink(text, row.sub_part.url + "stock/");
|
||||
}
|
||||
},
|
||||
{
|
||||
formatter: function(value, row, index, field) {
|
||||
return editButton(row.url + 'edit') + ' ' + deleteButton(row.url + 'delete');
|
||||
|
Loading…
Reference in New Issue
Block a user