From a1525d1289b3b7a7a6a5fac896d83842a90b7cd1 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 21 Feb 2025 17:05:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20mb=20create=E5=8A=A0=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/inm/services.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/inm/services.py b/apps/inm/services.py index c7a9d36e..4f05a2b7 100644 --- a/apps/inm/services.py +++ b/apps/inm/services.py @@ -325,7 +325,7 @@ class InmService: state = WMaterial.WM_OK if defect: state = WMaterial.WM_NOTOK - mb, _ = MaterialBatch.objects.get_or_create( + mb, _ = MaterialBatch.safe_get_or_create( material=material, warehouse=warehouse, batch=batch,