From e959f11051437c94266565f23a4d596e09d40be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Thu, 30 Dec 2021 23:33:43 +0100 Subject: [PATCH] Add lot to stock model. --- .../parts/migrations/0007_stock_lot.py | 18 ++++++++++++++++++ shimatta_kenkyusho/parts/models.py | 1 + 2 files changed, 19 insertions(+) create mode 100644 shimatta_kenkyusho/parts/migrations/0007_stock_lot.py diff --git a/shimatta_kenkyusho/parts/migrations/0007_stock_lot.py b/shimatta_kenkyusho/parts/migrations/0007_stock_lot.py new file mode 100644 index 0000000..67d64fa --- /dev/null +++ b/shimatta_kenkyusho/parts/migrations/0007_stock_lot.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.5 on 2021-12-30 22:32 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('parts', '0006_auto_20211114_1524'), + ] + + operations = [ + migrations.AddField( + model_name='stock', + name='lot', + field=models.CharField(blank=True, max_length=255, null=True), + ), + ] diff --git a/shimatta_kenkyusho/parts/models.py b/shimatta_kenkyusho/parts/models.py index 12ecce6..8c14ffe 100644 --- a/shimatta_kenkyusho/parts/models.py +++ b/shimatta_kenkyusho/parts/models.py @@ -227,6 +227,7 @@ class Stock(models.Model): storage = models.ForeignKey(Storage, on_delete=models.PROTECT, blank=True, null=True) amount = models.PositiveIntegerField() watermark = models.IntegerField() # negative is no watermark + lot = models.CharField(max_length=255, null=True, blank=True) def atomic_increment(self, increment): if self.amount + increment < 0: