aboutsummaryrefslogtreecommitdiffstats
path: root/servo/models
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/models
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/models')
-rw-r--r--servo/models/order.py11
1 files changed, 7 insertions, 4 deletions
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: