2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 20:16:44 +00:00

Add "instance_filters" for SupplierPart model

- Restrict the "manufacturer_part" query based on the current part
This commit is contained in:
Oliver 2021-08-10 11:00:27 +10:00
parent 7117c33379
commit e03afce335

View File

@ -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')