fix: 废弃一些接口

This commit is contained in:
caoqianming 2024-03-06 18:01:24 +08:00
parent 8a32690395
commit b429ad9059
3 changed files with 6 additions and 3 deletions

View File

@ -314,6 +314,8 @@ class DeptBatchSerializer(serializers.Serializer):
class HandoverSerializer(CustomModelSerializer):
wm = serializers.PrimaryKeyRelatedField(
label='车间库存ID', queryset=WMaterial.objects.all())
material = serializers.PrimaryKeyRelatedField(
required=True, label='物料ID', queryset=Material.objects.all())
send_user_name = serializers.CharField(

View File

@ -284,7 +284,7 @@ def handover_submit(handover: Handover, user: User, now: Union[datetime.datetime
if handover.wm:
wm: WMaterial = handover.wm
need_add = True
if '混料' in wm.material.name:
if '混料' in wm.material.name: # hard code
need_add = False
count_x = wm.count - handover.count
if count_x < 0:
@ -299,6 +299,7 @@ def handover_submit(handover: Handover, user: User, now: Union[datetime.datetime
'batch': handover.batch, 'material': handover.material, 'belong_dept': handover.send_dept
})
wm_to.count = wm_to.count + handover.count
wm_to.count_eweight = handover.count_eweight
wm_to.save()
handover.submit_user = user
handover.submit_time = now

View File

@ -310,7 +310,7 @@ class HandoverViewSet(CustomModelViewSet):
@action(methods=['post'], detail=False, perms_map={'post': 'handover.create'}, serializer_class=GenHandoverWmSerializer)
@transaction.atomic
def gen_by_wm(self, request):
"""从车间库存生成交接记录
"""从车间库存生成交接记录(废弃)
从车间库存生成交接记录
"""
@ -340,7 +340,7 @@ class HandoverViewSet(CustomModelViewSet):
@action(methods=['post'], detail=False, perms_map={'post': 'handover.create'}, serializer_class=GenHandoverSerializer)
@transaction.atomic
def gen_by_mlog(self, request):
"""从生产日志生成交接记录
"""从生产日志生成交接记录(废弃)
从生产日志生成交接记录
"""