mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 21:25:42 +00:00 
			
		
		
		
	Add 'destination' field to POLineItem API serializer
This commit is contained in:
		| @@ -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', | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user