2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-02 03:30:54 +00:00

Add quantity field to StockItemTracking

- Keep track of historical levels of part availability
This commit is contained in:
Oliver Walters
2019-04-13 00:14:10 +10:00
parent 93bb0bf6f4
commit 926d717190
4 changed files with 29 additions and 0 deletions

View File

@ -209,6 +209,7 @@ class StockItem(models.Model):
item=self,
title=title,
user=user,
quantity=self.quantity,
date=datetime.now().date(),
notes=notes,
system=system
@ -346,6 +347,9 @@ class StockItemTracking(models.Model):
# Was this tracking note auto-generated by the system?
system = models.BooleanField(default=False)
# Keep track of the StockItem quantity throughout the tracking history
quantity = models.PositiveIntegerField(validators=[MinValueValidator(0)], default=1)
# TODO
# image = models.ImageField(upload_to=func, max_length=255, null=True, blank=True)