This commit is contained in:
zty 2024-08-01 15:55:22 +08:00
commit c293dd068f
1 changed files with 3 additions and 3 deletions

View File

@ -365,7 +365,7 @@ def mlog_revert(mlog: Mlog, user: User, now: Union[datetime.datetime, None]):
list_m = Mlogb.objects.filter(mlog=mlog).values_list('mtask__id', flat=True).distinct()
update_mtaskIds += list(list_m)
if update_mtaskIds:
Mtask.objects.filter(id__in=update_mtaskIds, state=Mtask.MTASK_SUBMIT).update(status=Mtask.MTASK_ASSGINED)
Mtask.objects.filter(id__in=update_mtaskIds, state=Mtask.MTASK_SUBMIT).update(state=Mtask.MTASK_ASSGINED)
def cal_mlog_count_from_mlogb(mlog: Mlog):
@ -511,11 +511,11 @@ def handover_submit(handover: Handover, user: User, now: Union[datetime.datetime
wm_from.save()
if need_add:
if handover.recive_mgroup:
# 处理返工交接
if handover.type == Handover.H_NORMAL:
wm_to, _ = WMaterial.objects.get_or_create(batch=batch, material=material, mgroup=handover.recive_mgroup, defaults={
wm_to, _ = WMaterial.objects.get_or_create(batch=batch, material=material, mgroup=handover.recive_mgroup, material_origin=None, defaults={
'batch': batch, 'material': material, 'mgroup': handover.recive_mgroup, 'belong_dept': handover.recive_dept
})
# 处理返工交接
elif handover.type == Handover.H_REPAIR:
wm_to, _ = WMaterial.objects.get_or_create(
batch=batch,