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

Add setting to allow or prohibit duplicate IPN values

This commit is contained in:
Oliver Walters
2020-11-10 09:03:26 +11:00
parent eead52a5dd
commit a6028f027a
6 changed files with 73 additions and 0 deletions

View File

@ -1247,12 +1247,21 @@ class StockItem(MPTTModel):
@property
def required_test_count(self):
"""
Return the number of 'required tests' for this StockItem
"""
return self.part.getRequiredTests().count()
def hasRequiredTests(self):
"""
Return True if there are any 'required tests' associated with this StockItem
"""
return self.part.getRequiredTests().count() > 0
def passedAllRequiredTests(self):
"""
Returns True if this StockItem has passed all required tests
"""
status = self.requiredTestStatus()