From 7671eb2b22b50a9428fe1ee97250a6991edf265d Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 5 Sep 2019 12:58:11 +1000 Subject: [PATCH] Add a checksum field to the bom line item --- .../part/migrations/0017_bomitem_checksum.py | 18 ++++++++++++++++++ InvenTree/part/models.py | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 InvenTree/part/migrations/0017_bomitem_checksum.py diff --git a/InvenTree/part/migrations/0017_bomitem_checksum.py b/InvenTree/part/migrations/0017_bomitem_checksum.py new file mode 100644 index 0000000000..3dfaae7a09 --- /dev/null +++ b/InvenTree/part/migrations/0017_bomitem_checksum.py @@ -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), + ), + ] diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index 4a4c5fb606..2eb8f9f842 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -1121,6 +1121,7 @@ class BomItem(models.Model): 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%') note: Note field for this BOM item + checksum: Validation checksum for the particular BOM line item """ def get_absolute_url(self): @@ -1154,6 +1155,8 @@ class BomItem(models.Model): # Note attached to this BOM line item 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): """ Check validity of the BomItem model.