From 25e41b3fa2cf1149d2cd1c3fbe1c53a17f871cfc Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 12 May 2019 21:20:43 +1000 Subject: [PATCH] Allow null values for StockItem.updated - Just to make the tests run better --- .../migrations/0016_auto_20190512_2119.py | 18 ++++++++++++++++++ InvenTree/stock/models.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 InvenTree/stock/migrations/0016_auto_20190512_2119.py diff --git a/InvenTree/stock/migrations/0016_auto_20190512_2119.py b/InvenTree/stock/migrations/0016_auto_20190512_2119.py new file mode 100644 index 0000000000..582e68d277 --- /dev/null +++ b/InvenTree/stock/migrations/0016_auto_20190512_2119.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2 on 2019-05-12 11:19 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('stock', '0015_stockitem_delete_on_deplete'), + ] + + operations = [ + migrations.AlterField( + model_name='stockitem', + name='updated', + field=models.DateField(auto_now=True, null=True), + ), + ] diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index 09b9cafff4..f4956d32e6 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -211,7 +211,7 @@ class StockItem(models.Model): quantity = models.PositiveIntegerField(validators=[MinValueValidator(0)], default=1) - updated = models.DateField(auto_now=True) + updated = models.DateField(auto_now=True, null=True) # last time the stock was checked / counted stocktake_date = models.DateField(blank=True, null=True)