2021-01-18 09:55:30 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from InvenTree.serializers import InvenTreeModelSerializer
|
|
|
|
from InvenTree.serializers import InvenTreeAttachmentSerializerField
|
|
|
|
|
|
|
|
from .models import TestReport
|
2021-02-15 21:25:04 +00:00
|
|
|
from .models import BuildReport
|
2021-02-12 09:55:13 +00:00
|
|
|
from .models import BillOfMaterialsReport
|
2021-03-10 05:53:02 +00:00
|
|
|
from .models import PurchaseOrderReport, SalesOrderReport
|
2021-01-18 09:55:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
class TestReportSerializer(InvenTreeModelSerializer):
|
|
|
|
|
|
|
|
template = InvenTreeAttachmentSerializerField(required=True)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = TestReport
|
|
|
|
fields = [
|
2021-02-15 21:25:52 +00:00
|
|
|
'pk',
|
|
|
|
'name',
|
|
|
|
'description',
|
|
|
|
'template',
|
|
|
|
'filters',
|
|
|
|
'enabled',
|
|
|
|
]
|
2021-02-12 09:55:13 +00:00
|
|
|
|
|
|
|
|
2021-02-15 21:25:04 +00:00
|
|
|
class BuildReportSerializer(InvenTreeModelSerializer):
|
|
|
|
|
|
|
|
template = InvenTreeAttachmentSerializerField(required=True)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = BuildReport
|
|
|
|
fields = [
|
|
|
|
'pk',
|
|
|
|
'name',
|
|
|
|
'description',
|
|
|
|
'template',
|
|
|
|
'filters',
|
|
|
|
'enabled',
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2021-02-12 09:55:13 +00:00
|
|
|
class BOMReportSerializer(InvenTreeModelSerializer):
|
|
|
|
|
|
|
|
template = InvenTreeAttachmentSerializerField(required=True)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = BillOfMaterialsReport
|
|
|
|
fields = [
|
2021-02-15 21:25:52 +00:00
|
|
|
'pk',
|
|
|
|
'name',
|
|
|
|
'description',
|
|
|
|
'template',
|
|
|
|
'filters',
|
|
|
|
'enabled',
|
|
|
|
]
|
2021-03-10 05:53:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
class POReportSerializer(InvenTreeModelSerializer):
|
|
|
|
|
|
|
|
template = InvenTreeAttachmentSerializerField(required=True)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = PurchaseOrderReport
|
|
|
|
fields = [
|
|
|
|
'pk',
|
|
|
|
'name',
|
|
|
|
'description',
|
|
|
|
'template',
|
|
|
|
'filters',
|
|
|
|
'enabled',
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
class SOReportSerializer(InvenTreeModelSerializer):
|
|
|
|
|
|
|
|
template = InvenTreeAttachmentSerializerField(required=True)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = SalesOrderReport
|
|
|
|
fields = [
|
|
|
|
'pk',
|
|
|
|
'name',
|
|
|
|
'description',
|
|
|
|
'template',
|
|
|
|
'filters',
|
|
|
|
'enabled',
|
|
|
|
]
|