diff --git a/InvenTree/order/serializers.py b/InvenTree/order/serializers.py index 809dd0e8fb..4a95bbb166 100644 --- a/InvenTree/order/serializers.py +++ b/InvenTree/order/serializers.py @@ -132,7 +132,7 @@ class POLineItemSerializer(InvenTreeModelSerializer): 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( choices=currency_code_mappings(), @@ -156,6 +156,7 @@ class POLineItemSerializer(InvenTreeModelSerializer): 'purchase_price_currency', 'purchase_price_string', 'destination', + 'destination_detail', ] diff --git a/InvenTree/order/templates/order/purchase_order_detail.html b/InvenTree/order/templates/order/purchase_order_detail.html index 54d0ca76be..193fd75daa 100644 --- a/InvenTree/order/templates/order/purchase_order_detail.html +++ b/InvenTree/order/templates/order/purchase_order_detail.html @@ -401,8 +401,15 @@ $("#po-table").inventreeTable({ } }, { - field: 'destination.pathstring', + field: 'destination', title: '{% trans "Destination" %}', + formatter: function(value, row) { + if (value) { + return renderLink(row.destination_detail.pathstring, `/stock/location/${value}/`); + } else { + return '-'; + } + } }, { field: 'notes',