mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +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):
|
class BuildSerializer(serializers.ModelSerializer):
|
||||||
|
|
||||||
url = serializers.CharField(source='get_absolute_url', read_only=True)
|
url = serializers.CharField(source='get_absolute_url', read_only=True)
|
||||||
|
status_text = serializers.CharField(source='get_status_display', read_only=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Build
|
model = Build
|
||||||
@ -20,4 +21,6 @@ class BuildSerializer(serializers.ModelSerializer):
|
|||||||
'completion_date',
|
'completion_date',
|
||||||
'part',
|
'part',
|
||||||
'quantity',
|
'quantity',
|
||||||
|
'status',
|
||||||
|
'status_text',
|
||||||
'notes']
|
'notes']
|
||||||
|
@ -365,7 +365,7 @@ function loadStockTable(modal, options) {
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
var text = renderLink(value, row.url);
|
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;
|
return text;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -63,6 +63,7 @@ class StockItemSerializer(serializers.ModelSerializer):
|
|||||||
|
|
||||||
part = PartBriefSerializer(many=False, read_only=True)
|
part = PartBriefSerializer(many=False, read_only=True)
|
||||||
location = LocationBriefSerializer(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:
|
class Meta:
|
||||||
model = StockItem
|
model = StockItem
|
||||||
@ -78,6 +79,7 @@ class StockItemSerializer(serializers.ModelSerializer):
|
|||||||
'serial',
|
'serial',
|
||||||
'batch',
|
'batch',
|
||||||
'status',
|
'status',
|
||||||
|
'status_text',
|
||||||
'notes',
|
'notes',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user