From 70b5a4d87e0c7f12167fa1c7a4d816820f411fbd Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 4 Mar 2024 10:37:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20material=20unit=20=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E5=86=992?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/mtm/services.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/mtm/services.py b/apps/mtm/services.py index 1072983c..26130462 100644 --- a/apps/mtm/services.py +++ b/apps/mtm/services.py @@ -61,9 +61,8 @@ def daoru_material(path: str): 'model': model, 'unit__iexact': unit} if type in [20, 30]: filters['process'] = process - default = filters - default['number'] = f'm{type}_{ranstr(6)}' - default['id'] = idWorker.get_id() + default = {'type': type, 'name': name, 'specification': specification, + 'model': model, 'unit': unit, 'number': f'm{type}_{ranstr(6)}', 'id': idWorker.get_id()} Material.objects.update_or_create( defaults=default, **filters