mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add status_text to API
This commit is contained in:
parent
963883acd6
commit
ebcbf9a90e
@ -9,6 +9,7 @@ from .models import Build
|
||||
class BuildSerializer(serializers.ModelSerializer):
|
||||
|
||||
url = serializers.CharField(source='get_absolute_url', read_only=True)
|
||||
status_text = serializers.CharField(source='get_status_display', read_only=True)
|
||||
|
||||
class Meta:
|
||||
model = Build
|
||||
@ -20,4 +21,6 @@ class BuildSerializer(serializers.ModelSerializer):
|
||||
'completion_date',
|
||||
'part',
|
||||
'quantity',
|
||||
'status',
|
||||
'status_text',
|
||||
'notes']
|
||||
|
@ -365,7 +365,7 @@ function loadStockTable(modal, options) {
|
||||
sortable: true,
|
||||
formatter: function(value, row, index, field) {
|
||||
var text = renderLink(value, row.url);
|
||||
text = text + "<span class='badge'>" + row.status + "</span>";
|
||||
text = text + "<span class='badge'>" + row.status_text + "</span>";
|
||||
return text;
|
||||
}
|
||||
},
|
||||
|
@ -63,6 +63,7 @@ class StockItemSerializer(serializers.ModelSerializer):
|
||||
|
||||
part = PartBriefSerializer(many=False, read_only=True)
|
||||
location = LocationBriefSerializer(many=False, read_only=True)
|
||||
status_text = serializers.CharField(source='get_status_display', read_only=True)
|
||||
|
||||
class Meta:
|
||||
model = StockItem
|
||||
@ -78,6 +79,7 @@ class StockItemSerializer(serializers.ModelSerializer):
|
||||
'serial',
|
||||
'batch',
|
||||
'status',
|
||||
'status_text',
|
||||
'notes',
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user