mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Update serializer
This commit is contained in:
parent
c540004a60
commit
9ac82a93d5
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user