2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-28 14:25:56 +00:00

More refactoring

This commit is contained in:
Oliver Walters
2020-10-30 16:54:05 +11:00
parent c533f59405
commit e049ca1a85
8 changed files with 188 additions and 184 deletions

View File

@@ -1126,6 +1126,20 @@ class StockItem(MPTTModel):
return s
@transaction.atomic
def clear_test_results(self, **kwargs):
"""
Remove all test results
"""
# All test results
results = self.test_results.all()
# TODO - Perhaps some filtering options supplied by kwargs?
results.delete()
def getTestResults(self, test=None, result=None, user=None):
"""
Return all test results associated with this StockItem.