2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-06 05:30:56 +00:00

Include 'key' field in StockItemTestResult serializer

This commit is contained in:
Oliver Walters
2020-05-24 20:04:34 +10:00
parent 01481ef5c9
commit e4d10279fa
3 changed files with 10 additions and 1 deletions

View File

@ -1129,7 +1129,7 @@ class StockItemTestResult(models.Model):
super().clean()
# If this test result corresponds to a template, check the requirements of the template
key = helpers.generateTestKey(self.test)
key = self.key
templates = self.stock_item.part.getTestTemplates()
@ -1150,6 +1150,10 @@ class StockItemTestResult(models.Model):
break
@property
def key(self):
return helpers.generateTestKey(self.test)
stock_item = models.ForeignKey(
StockItem,
on_delete=models.CASCADE,