mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-12 10:05:39 +00:00
Add pages for part tracking
- Edit / Delete / Create tracking info - Improvements to many pages
This commit is contained in:
@ -115,6 +115,9 @@ class Part(models.Model):
|
||||
# and can have their movements tracked
|
||||
trackable = models.BooleanField(default=False)
|
||||
|
||||
# Is this part "purchaseable"?
|
||||
purchaseable = models.BooleanField(default=True)
|
||||
|
||||
def __str__(self):
|
||||
if self.IPN:
|
||||
return "{name} ({ipn})".format(
|
||||
@ -128,6 +131,10 @@ class Part(models.Model):
|
||||
verbose_name_plural = "Parts"
|
||||
#unique_together = (("name", "category"),)
|
||||
|
||||
@property
|
||||
def tracked_parts(self):
|
||||
return self.serials.order_by('serial')
|
||||
|
||||
@property
|
||||
def stock(self):
|
||||
""" Return the total stock quantity for this part.
|
||||
|
Reference in New Issue
Block a user