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

@ -0,0 +1,18 @@
# Generated by Django 3.0.7 on 2021-02-17 10:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('part', '0062_merge_20210105_0056'),
]
operations = [
migrations.AddField(
model_name='bomitem',
name='inherited',
field=models.BooleanField(default=False, help_text='This BOM item is inherited by BOMs for variant parts', verbose_name='Inherited'),
),
]

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%') 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 note: Note field for this BOM item
checksum: Validation checksum for the particular BOM line 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): 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')) 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): def get_item_hash(self):
""" Calculate the checksum hash of this BOM line item: """ Calculate the checksum hash of this BOM line item: