aboutsummaryrefslogtreecommitdiffstats
path: root/servo
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2021-05-15 15:00:45 +0300
committerFilipp Lepalaan <filipp@mac.com>2021-05-15 15:00:45 +0300
commit3af675351bbc1c2a8a652049d12e7b699744d730 (patch)
tree2414129c2e5a08559f1197fdbcbb23f5caab0a1d /servo
parentf03dce6a5e22c13884c3017e78e4a302c43259aa (diff)
downloadServo-3af675351bbc1c2a8a652049d12e7b699744d730.tar.gz
Servo-3af675351bbc1c2a8a652049d12e7b699744d730.tar.bz2
Servo-3af675351bbc1c2a8a652049d12e7b699744d730.zip
Add unit_received_at and customer_contacted_at fields
Diffstat (limited to 'servo')
-rw-r--r--servo/migrations/0003_auto_20210515_1333.py43
-rw-r--r--servo/models/order.py11
2 files changed, 50 insertions, 4 deletions
diff --git a/servo/migrations/0003_auto_20210515_1333.py b/servo/migrations/0003_auto_20210515_1333.py
new file mode 100644
index 0000000..10d18e4
--- /dev/null
+++ b/servo/migrations/0003_auto_20210515_1333.py
@@ -0,0 +1,43 @@
+# Generated by Django 3.2.2 on 2021-05-15 11:33
+
+from django.db import migrations, models
+import servo.defaults
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('servo', '0002_auto_20210513_0651'),
+ ]
+
+ operations = [
+ migrations.AlterModelOptions(
+ name='device',
+ options={'get_latest_by': 'id', 'ordering': ['description']},
+ ),
+ migrations.AddField(
+ model_name='order',
+ name='customer_contacted_at',
+ field=models.DateTimeField(null=True),
+ ),
+ migrations.AddField(
+ model_name='order',
+ name='unit_received_at',
+ field=models.DateTimeField(null=True),
+ ),
+ migrations.AlterField(
+ model_name='queue',
+ name='locations',
+ field=models.ManyToManyField(help_text='Pick the locations you want this queue to appear in.', null=True, to='servo.Location', verbose_name='locations'),
+ ),
+ migrations.AlterField(
+ model_name='user',
+ name='locale',
+ field=models.CharField(choices=[('da_DK.UTF-8', 'Danish'), ('nl_NL.UTF-8', 'Dutch'), ('en_US.UTF-8', 'English'), ('et_EE.UTF-8', 'Estonian'), ('fi_FI.UTF-8', 'Finnish'), ('pl_PL.UTF-8', 'Polish'), ('sv_SE.UTF-8', 'Swedish')], default='da_DK.UTF-8', help_text='Select which language you want to use Servo in.', max_length=32, verbose_name='Language'),
+ ),
+ migrations.AlterField(
+ model_name='user',
+ name='region',
+ field=models.CharField(choices=[('da_DK.UTF-8', 'Denmark'), ('et_EE.UTF-8', 'Estonia'), ('fi_FI.UTF-8', 'Finland'), ('nl_NL.UTF-8', 'Netherlands'), ('pl_PL.UTF-8', 'Poland'), ('sv_SE.UTF-8', 'Sweden'), ('en_US.UTF-8', 'United States')], default=servo.defaults.locale, help_text='Affects formatting of numbers, dates and currencies.', max_length=32, verbose_name='region'),
+ ),
+ ]
diff --git a/servo/models/order.py b/servo/models/order.py
index 980ae54..344100d 100644
--- a/servo/models/order.py
+++ b/servo/models/order.py
@@ -55,6 +55,9 @@ class Order(models.Model):
on_delete=models.SET_NULL
)
+ unit_received_at = models.DateTimeField(null=True)
+ customer_contacted_at = models.DateTimeField(null=True)
+
closed_at = models.DateTimeField(null=True)
closed_by = models.ForeignKey(
settings.AUTH_USER_MODEL,
@@ -837,7 +840,7 @@ class Order(models.Model):
def get_absolute_url(self):
return reverse("orders-edit", args=[self.pk])
- def __unicode__(self):
+ def __str__(self):
return self.code
@@ -1025,7 +1028,7 @@ class ServiceOrderItem(AbstractOrderItem):
def is_warranty(self):
return self.price_category == 'warranty'
- def __unicode__(self):
+ def __str__(self):
return self.code
class Meta:
@@ -1118,7 +1121,7 @@ class OrderStatus(models.Model):
statuses = self.order.orderstatus_set
return statuses.filter(started_at__lt=self.started_at).order_by('id').last()
- def __unicode__(self):
+ def __str__(self):
return self.status.title
class Meta:
@@ -1167,7 +1170,7 @@ class Accessory(models.Model):
device = models.ForeignKey(Device, on_delete=models.CASCADE)
order = models.ForeignKey(Order, on_delete=models.CASCADE)
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta: