feat: handover根据wm完善batch字段
This commit is contained in:
parent
6539bc2e61
commit
f41068e923
|
@ -1013,6 +1013,8 @@ class HandoverSerializer(CustomModelSerializer):
|
|||
|
||||
|
||||
wm:WMaterial = attrs.get('wm', None)
|
||||
if wm:
|
||||
attrs["batch"] = wm.batch
|
||||
handoverb = attrs.get('handoverb', [])
|
||||
if wm and not handoverb:
|
||||
attrs['handoverb'] = [{"wm": wm, "count": attrs["count"] }]
|
||||
|
|
|
@ -383,7 +383,7 @@ class HandoverViewSet(CustomModelViewSet):
|
|||
select_related_fields = ['send_user', 'send_mgroup', 'send_dept', 'recive_user', 'recive_mgroup', 'recive_dept', 'wm']
|
||||
filterset_class = HandoverFilter
|
||||
search_fields = ['id', 'material__name',
|
||||
'material__number', 'material__specification', 'batch', 'material__model', 'b_handover__batch', "new_batch"]
|
||||
'material__number', 'material__specification', 'batch', 'material__model', 'b_handover__batch', "new_batch", "wm__batch"]
|
||||
prefetch_related_fields = ["b_handover"]
|
||||
|
||||
def perform_destroy(self, instance):
|
||||
|
|
Loading…
Reference in New Issue