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:
parent
7117c33379
commit
e03afce335
@ -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')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user