Add lot to stock model.
This commit is contained in:
parent
e6eb9346a8
commit
e959f11051
18
shimatta_kenkyusho/parts/migrations/0007_stock_lot.py
Normal file
18
shimatta_kenkyusho/parts/migrations/0007_stock_lot.py
Normal file
@ -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),
|
||||||
|
),
|
||||||
|
]
|
@ -227,6 +227,7 @@ class Stock(models.Model):
|
|||||||
storage = models.ForeignKey(Storage, on_delete=models.PROTECT, blank=True, null=True)
|
storage = models.ForeignKey(Storage, on_delete=models.PROTECT, blank=True, null=True)
|
||||||
amount = models.PositiveIntegerField()
|
amount = models.PositiveIntegerField()
|
||||||
watermark = models.IntegerField() # negative is no watermark
|
watermark = models.IntegerField() # negative is no watermark
|
||||||
|
lot = models.CharField(max_length=255, null=True, blank=True)
|
||||||
|
|
||||||
def atomic_increment(self, increment):
|
def atomic_increment(self, increment):
|
||||||
if self.amount + increment < 0:
|
if self.amount + increment < 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user