mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Limit sub-part choices to consumable parts only
This commit is contained in:
parent
bad46f85f4
commit
bafce641a7
@ -371,11 +371,12 @@ class BomItem(models.Model):
|
||||
# A link to the parent part
|
||||
# Each part will get a reverse lookup field 'bom_items'
|
||||
part = models.ForeignKey(Part, on_delete=models.CASCADE, related_name='bom_items',
|
||||
limit_choices_to={'buildable': True})
|
||||
limit_choices_to={'buildable': True})
|
||||
|
||||
# A link to the child item (sub-part)
|
||||
# Each part will get a reverse lookup field 'used_in'
|
||||
sub_part = models.ForeignKey(Part, on_delete=models.CASCADE, related_name='used_in')
|
||||
sub_part = models.ForeignKey(Part, on_delete=models.CASCADE, related_name='used_in',
|
||||
limit_choices_to={'consumable': True})
|
||||
|
||||
# Quantity required
|
||||
quantity = models.PositiveIntegerField(default=1, validators=[MinValueValidator(0)])
|
||||
|
Loading…
Reference in New Issue
Block a user