From 1ab3b4eb7adffd7bbc08a8ba744b7addcc7c6a74 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 28 Oct 2021 13:44:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/inm/signals.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hb_server/apps/inm/signals.py b/hb_server/apps/inm/signals.py index 26809eb..bbc9ec3 100644 --- a/hb_server/apps/inm/signals.py +++ b/hb_server/apps/inm/signals.py @@ -5,14 +5,14 @@ from apps.inm.models import FIFODetail, Inventory, MaterialBatch @receiver(post_save, sender=FIFODetail) -def create_user(sender, instance, created, **kwargs): +def update_by_fifodetail(sender, instance, created, **kwargs): if created: fifo = instance.fifo material = instance.material warehouse = fifo.warehouse if fifo.type in [3]: # 采购入库 # 更新相关表 - o1 = Inventory.objects.get_or_create(material=material, warehouse=warehouse, \ + o1, _ = Inventory.objects.get_or_create(material=material, warehouse=warehouse, \ defaults={'material':material, 'warehouse':warehouse, 'count':0}) o1.count = o1.count + instance.count o1.save()