mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-30 20:55:42 +00:00 
			
		
		
		
	Expose 'contact' field for PurchaseOrder model
This commit is contained in:
		| @@ -99,6 +99,8 @@ class PurchaseOrderSerializer(AbstractOrderSerializer, InvenTreeModelSerializer) | ||||
|             'reference', | ||||
|             'responsible', | ||||
|             'responsible_detail', | ||||
|             'contact', | ||||
|             'contact_detail', | ||||
|             'supplier', | ||||
|             'supplier_detail', | ||||
|             'supplier_reference', | ||||
| @@ -148,6 +150,8 @@ class PurchaseOrderSerializer(AbstractOrderSerializer, InvenTreeModelSerializer) | ||||
|  | ||||
|         return queryset | ||||
|  | ||||
|     contact_detail = ContactSerializer(source='contact', many=False, read_only=True) | ||||
|  | ||||
|     supplier_detail = CompanyBriefSerializer(source='supplier', many=False, read_only=True) | ||||
|  | ||||
|     line_items = serializers.IntegerField(read_only=True) | ||||
|   | ||||
| @@ -70,6 +70,18 @@ function purchaseOrderFields(options={}) { | ||||
|         link: { | ||||
|             icon: 'fa-link', | ||||
|         }, | ||||
|         contact: { | ||||
|             icon: 'fa-user', | ||||
|             adjustFilters: function(filters) { | ||||
|                 let supplier = getFormFieldValue('supplier', {}, {modal: options.modal}); | ||||
|  | ||||
|                 if (supplier) { | ||||
|                     filters.company = supplier; | ||||
|                 } | ||||
|  | ||||
|                 return filters; | ||||
|             } | ||||
|         }, | ||||
|         responsible: { | ||||
|             icon: 'fa-user', | ||||
|         }, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user