2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-30 16:41:35 +00:00

Add "allow_variants" field to BomItem

This commit is contained in:
Oliver Walters
2021-06-01 13:59:01 +10:00
parent 96624d1175
commit 5c71f04360
3 changed files with 30 additions and 4 deletions

@@ -2240,6 +2240,7 @@ class BomItem(models.Model):
note: Note field for this BOM item
checksum: Validation checksum for the particular BOM line item
inherited: This BomItem can be inherited by the BOMs of variant parts
allow_variants: Stock for part variants can be substituted for this BomItem
"""
def save(self, *args, **kwargs):
@@ -2288,6 +2289,12 @@ class BomItem(models.Model):
help_text=_('This BOM item is inherited by BOMs for variant parts'),
)
allow_variants = models.BooleanField(
default=False,
verbose_name=_('Allow Variants'),
help_text=_('Stock items for variant parts can be used for this BOM item')
)
def get_item_hash(self):
""" Calculate the checksum hash of this BOM line item: