From 779488589a0798c7a17e2f90b44bd88924603b60 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 6 Mar 2024 22:24:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20handover=5Fsubmit=E9=92=88=E5=AF=B9?= =?UTF-8?q?=E6=B7=B7=E6=96=99=E7=89=B9=E6=AE=8A=E5=A4=84=E7=90=86=E7=9A=84?= =?UTF-8?q?bug3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/services.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/wpm/services.py b/apps/wpm/services.py index d24b7112..6d2742d1 100644 --- a/apps/wpm/services.py +++ b/apps/wpm/services.py @@ -301,8 +301,8 @@ def handover_submit(handover: Handover, user: User, now: Union[datetime.datetime wm_from.count = count_x wm_from.save() if need_add: - wm_to, _ = WMaterial.objects.get_or_create(batch=handover.batch, material=handover.material, belong_dept=handover.send_dept, defaults={ - 'batch': handover.batch, 'material': handover.material, 'belong_dept': handover.send_dept + wm_to, _ = WMaterial.objects.get_or_create(batch=batch, material=material, belong_dept=handover.recive_dept, defaults={ + 'batch': batch, 'material': material, 'belong_dept': handover.recive_dept }) wm_to.count = wm_to.count + handover.count wm_to.count_eweight = handover.count_eweight