Add a checksum field to the bom line item

This commit is contained in:
Oliver Walters 2019-09-05 12:58:11 +10:00
parent c96c4d16a3
commit 7671eb2b22
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 2.2.4 on 2019-09-05 02:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('part', '0016_auto_20190820_0257'),
]
operations = [
migrations.AddField(
model_name='bomitem',
name='checksum',
field=models.CharField(blank=True, help_text='BOM line checksum', max_length=128),
),
]

View File

@ -1121,6 +1121,7 @@ class BomItem(models.Model):
reference: BOM reference field (e.g. part designators) reference: BOM reference field (e.g. part designators)
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
""" """
def get_absolute_url(self): def get_absolute_url(self):
@ -1154,6 +1155,8 @@ class BomItem(models.Model):
# Note attached to this BOM line item # Note attached to this BOM line item
note = models.CharField(max_length=500, blank=True, help_text='BOM item notes') note = models.CharField(max_length=500, blank=True, help_text='BOM item notes')
checksum = models.CharField(max_length=128, blank=True, help_text='BOM line checksum')
def clean(self): def clean(self):
""" Check validity of the BomItem model. """ Check validity of the BomItem model.