From a0ad95ab281545a126707ea35a5d062557126ac9 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 2 May 2019 21:23:53 +1000 Subject: [PATCH] Save the date of Build cancellation --- InvenTree/build/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/InvenTree/build/models.py b/InvenTree/build/models.py index 79bedd5616..0e0068fdaf 100644 --- a/InvenTree/build/models.py +++ b/InvenTree/build/models.py @@ -133,6 +133,9 @@ class Build(models.Model): for item in self.allocated_stock.all(): item.delete() + # Date of 'completion' is the date the build was cancelled + self.completion_date = datetime.now().date() + self.status = self.CANCELLED self.save()