mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add 'destination' field to POLineItem API serializer
This commit is contained in:
parent
8c1248d74b
commit
e17b92b126
@ -132,7 +132,7 @@ class POLineItemSerializer(InvenTreeModelSerializer):
|
|||||||
|
|
||||||
purchase_price_string = serializers.CharField(source='purchase_price', read_only=True)
|
purchase_price_string = serializers.CharField(source='purchase_price', read_only=True)
|
||||||
|
|
||||||
destination = LocationBriefSerializer(source='get_destination', read_only=True)
|
destination_detail = LocationBriefSerializer(source='get_destination', read_only=True)
|
||||||
|
|
||||||
purchase_price_currency = serializers.ChoiceField(
|
purchase_price_currency = serializers.ChoiceField(
|
||||||
choices=currency_code_mappings(),
|
choices=currency_code_mappings(),
|
||||||
@ -156,6 +156,7 @@ class POLineItemSerializer(InvenTreeModelSerializer):
|
|||||||
'purchase_price_currency',
|
'purchase_price_currency',
|
||||||
'purchase_price_string',
|
'purchase_price_string',
|
||||||
'destination',
|
'destination',
|
||||||
|
'destination_detail',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -401,8 +401,15 @@ $("#po-table").inventreeTable({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'destination.pathstring',
|
field: 'destination',
|
||||||
title: '{% trans "Destination" %}',
|
title: '{% trans "Destination" %}',
|
||||||
|
formatter: function(value, row) {
|
||||||
|
if (value) {
|
||||||
|
return renderLink(row.destination_detail.pathstring, `/stock/location/${value}/`);
|
||||||
|
} else {
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'notes',
|
field: 'notes',
|
||||||
|
Loading…
Reference in New Issue
Block a user