mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-01 13:06:45 +00:00
Added ETA for part stock
This commit is contained in:
parent
2355adb044
commit
b2eca2aa48
@ -62,6 +62,7 @@ class ProjectPart(models.Model):
|
|||||||
name=self.part.name,
|
name=self.part.name,
|
||||||
quan=self.quantity)
|
quan=self.quantity)
|
||||||
|
|
||||||
|
|
||||||
class ProjectRun(models.Model):
|
class ProjectRun(models.Model):
|
||||||
""" A single run of a particular project.
|
""" A single run of a particular project.
|
||||||
Tracks the number of 'units' made in the project.
|
Tracks the number of 'units' made in the project.
|
||||||
|
@ -15,7 +15,7 @@ class StockItem(models.Model):
|
|||||||
on_delete=models.CASCADE,
|
on_delete=models.CASCADE,
|
||||||
related_name='locations')
|
related_name='locations')
|
||||||
location = models.ForeignKey(Warehouse, on_delete=models.CASCADE)
|
location = models.ForeignKey(Warehouse, on_delete=models.CASCADE)
|
||||||
quantity = models.IntegerField()
|
quantity = models.PositiveIntegerField()
|
||||||
updated = models.DateField(auto_now=True)
|
updated = models.DateField(auto_now=True)
|
||||||
|
|
||||||
# Stock status types
|
# Stock status types
|
||||||
@ -25,7 +25,8 @@ class StockItem(models.Model):
|
|||||||
ITEM_ATTENTION = 20
|
ITEM_ATTENTION = 20
|
||||||
ITEM_COMPLETE = 50
|
ITEM_COMPLETE = 50
|
||||||
|
|
||||||
status = models.IntegerField(default=ITEM_IN_PROGRESS,
|
status = models.PositiveIntegerField(
|
||||||
|
default=ITEM_IN_PROGRESS,
|
||||||
choices=[
|
choices=[
|
||||||
(ITEM_IN_PROGRESS, "In progress"),
|
(ITEM_IN_PROGRESS, "In progress"),
|
||||||
(ITEM_INCOMING, "Incoming"),
|
(ITEM_INCOMING, "Incoming"),
|
||||||
@ -34,6 +35,9 @@ class StockItem(models.Model):
|
|||||||
(ITEM_COMPLETE, "Complete")
|
(ITEM_COMPLETE, "Complete")
|
||||||
])
|
])
|
||||||
|
|
||||||
|
# If stock item is incoming, an (optional) ETA field
|
||||||
|
expected_arrival = models.DateField(null=True, blank=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "{n} x {part} @ {loc}".format(
|
return "{n} x {part} @ {loc}".format(
|
||||||
n=self.quantity,
|
n=self.quantity,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user