2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-16 03:55:41 +00:00

Add 'inherited' field to BomItem

This commit is contained in:
Oliver Walters
2021-02-17 21:53:15 +11:00
parent 69708b842c
commit d692c18274
2 changed files with 25 additions and 0 deletions

View File

@ -1977,6 +1977,7 @@ class BomItem(models.Model):
overage: Estimated losses for a Build. Can be expressed as absolute value (e.g. '7') or a percentage (e.g. '2%')
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
"""
def save(self, *args, **kwargs):
@ -2016,6 +2017,12 @@ class BomItem(models.Model):
checksum = models.CharField(max_length=128, blank=True, help_text=_('BOM line checksum'))
inherited = models.BooleanField(
default=False,
verbose_name=_('Inherited'),
help_text=_('This BOM item is inherited by BOMs for variant parts'),
)
def get_item_hash(self):
""" Calculate the checksum hash of this BOM line item: