2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-13 08:21:26 +00:00

Add function to get all test results as a map

- This will be required for pushing out to a test report
This commit is contained in:
Oliver Walters
2020-05-16 20:45:10 +10:00
parent 2bb9fd9955
commit df91b8cf4d
3 changed files with 54 additions and 0 deletions

View File

@ -7,6 +7,7 @@ from rest_framework import serializers
from .models import StockItem, StockLocation
from .models import StockItemTracking
from .models import StockItemAttachment
from .models import StockItemTestResult
from django.db.models import Sum, Count
from django.db.models.functions import Coalesce
@ -216,6 +217,24 @@ class StockItemAttachmentSerializer(InvenTreeModelSerializer):
]
class StockItemTestResultSerializer(InvenTreeModelSerializer):
""" Serializer for the StockItemTestResult model """
class Meta:
model = StockItemTestResult
fields = [
'pk',
'test',
'result',
'value',
'attachment',
'notes',
'user',
'date'
]
class StockTrackingSerializer(InvenTreeModelSerializer):
""" Serializer for StockItemTracking model """