mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 05:05:42 +00:00 
			
		
		
		
	Add "instance_filters" for SupplierPart model
- Restrict the "manufacturer_part" query based on the current part
This commit is contained in:
		| @@ -475,6 +475,15 @@ class SupplierPart(models.Model): | ||||
|     def get_absolute_url(self): | ||||
|         return reverse('supplier-part-detail', kwargs={'pk': self.id}) | ||||
|  | ||||
|     def api_instance_filters(self): | ||||
|          | ||||
|         return { | ||||
|             'manufacturer_part': { | ||||
|                 'part': self.part.pk | ||||
|             } | ||||
|         } | ||||
|  | ||||
|  | ||||
|     class Meta: | ||||
|         unique_together = ('part', 'supplier', 'SKU') | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user