From 9ac82a93d5f78a6097889a28a8f1880fc4cc730a Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 13 May 2023 22:14:44 +1000 Subject: [PATCH] Update serializer --- InvenTree/build/serializers.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/InvenTree/build/serializers.py b/InvenTree/build/serializers.py index 4773d7e75e..cebd69bb58 100644 --- a/InvenTree/build/serializers.py +++ b/InvenTree/build/serializers.py @@ -20,6 +20,7 @@ from InvenTree.status_codes import StockStatus from stock.models import StockItem, StockLocation from stock.serializers import StockItemSerializerBrief, LocationSerializer +import common.serializers from part.models import BomItem from part.serializers import PartSerializer, PartBriefSerializer from users.serializers import OwnerSerializer @@ -46,6 +47,8 @@ class BuildSerializer(InvenTreeModelSerializer): 'parent', 'part', 'part_detail', + 'project_code', + 'project_code_detail', 'overdue', 'reference', 'sales_order', @@ -87,6 +90,8 @@ class BuildSerializer(InvenTreeModelSerializer): barcode_hash = serializers.CharField(read_only=True) + project_code_detail = common.serializers.ProjectCodeSerializer(source='project_code', many=False, read_only=True) + @staticmethod def annotate_queryset(queryset): """Add custom annotations to the BuildSerializer queryset, performing database queries as efficiently as possible.