2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-13 08:21:26 +00:00

Limit supplierpart part link to purchasable parts only

This commit is contained in:
Oliver Walters
2019-04-17 00:14:22 +10:00
parent cd0b6a6511
commit 5cd837be07
2 changed files with 22 additions and 1 deletions

View File

@ -458,7 +458,9 @@ class SupplierPart(models.Model):
# Link to an actual part
# The part will have a field 'supplier_parts' which links to the supplier part options
part = models.ForeignKey(Part, on_delete=models.CASCADE,
related_name='supplier_parts')
related_name='supplier_parts',
limit_choices_to={'purchasable': True},
)
supplier = models.ForeignKey(Company, on_delete=models.CASCADE,
related_name='parts')