aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--servo/migrations/0045_auto_20151123_2021.py39
-rw-r--r--servo/models/account.py7
-rw-r--r--servo/models/common.py13
3 files changed, 52 insertions, 7 deletions
diff --git a/servo/migrations/0045_auto_20151123_2021.py b/servo/migrations/0045_auto_20151123_2021.py
new file mode 100644
index 0000000..9361c6d
--- /dev/null
+++ b/servo/migrations/0045_auto_20151123_2021.py
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('servo', '0044_auto_20151118_2310'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='location',
+ name='checkin',
+ field=models.BooleanField(default=True, verbose_name='Use for check-in'),
+ ),
+ migrations.AlterField(
+ model_name='inventory',
+ name='amount_minimum',
+ field=models.PositiveIntegerField(default=0, verbose_name='Minimum amount'),
+ ),
+ migrations.AlterField(
+ model_name='inventory',
+ name='amount_ordered',
+ field=models.PositiveIntegerField(default=0, verbose_name='Ordered amount'),
+ ),
+ migrations.AlterField(
+ model_name='inventory',
+ name='amount_reserved',
+ field=models.PositiveIntegerField(default=0, verbose_name='Reserved amount'),
+ ),
+ migrations.AlterField(
+ model_name='inventory',
+ name='amount_stocked',
+ field=models.IntegerField(default=0, verbose_name='Stocked amount'),
+ ),
+ ]
diff --git a/servo/models/account.py b/servo/models/account.py
index 13718c2..d4549c6 100644
--- a/servo/models/account.py
+++ b/servo/models/account.py
@@ -150,13 +150,6 @@ class User(AbstractUser):
techies = TechieManager()
active = ActiveManager()
- def get_location_list(self):
- results = []
- for l in self.locations.all():
- results.append({'pk': l.pk, 'name': l.title})
-
- return results
-
@classmethod
def serialize(cls, queryset):
results = []
diff --git a/servo/models/common.py b/servo/models/common.py
index 2ab81f0..eedba96 100644
--- a/servo/models/common.py
+++ b/servo/models/common.py
@@ -462,6 +462,19 @@ class Location(models.Model):
verbose_name=_('Enabled')
)
+ checkin = models.BooleanField(
+ default=True,
+ verbose_name=_('Use for check-in')
+ )
+
+ @classmethod
+ def get_checkin_list(cls):
+ results = []
+ for l in cls.objects.filter(checkin=True):
+ results.append({'pk': l.pk, 'name': l.title})
+
+ return results
+
def get_shipto_choices(self):
return self.gsx_accounts.values_list('ship_to', 'ship_to')