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:
@ -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,
|
||||
|
Reference in New Issue
Block a user