From 1e5f26d645f58e08ad8666dcf235d9412a58f7cc Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Mon, 1 Jul 2024 15:29:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E5=BC=80=E5=A7=8B=E5=92=8C?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0rfid=5Fco?= =?UTF-8?q?de=E4=B8=8D=E4=B8=BA=E7=A9=BA=E7=9A=84=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/controllers/controllers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sf_manufacturing/controllers/controllers.py b/sf_manufacturing/controllers/controllers.py index afb3681c..3b2a8682 100644 --- a/sf_manufacturing/controllers/controllers.py +++ b/sf_manufacturing/controllers/controllers.py @@ -162,7 +162,8 @@ class Manufacturing_Connect(http.Controller): routing_type = ret['CraftId'] equipment_id = ret["DeviceId"] workorder = request.env['mrp.workorder'].sudo().search( - [('production_id', '=', production_id), ('routing_type', '=', routing_type)], limit=1) + [('production_id', '=', production_id), ('routing_type', '=', routing_type), + ('rfid_code', '!=', False)], limit=1) if not workorder: res = {'Succeed': False, 'ErrorCode': 202, 'Error': '该工单不存在'} return json.JSONEncoder().encode(res) @@ -209,7 +210,8 @@ class Manufacturing_Connect(http.Controller): production_id = ret['BillId'] routing_type = ret['CraftId'] workorder = request.env['mrp.workorder'].sudo().search( - [('production_id', '=', production_id), ('routing_type', '=', routing_type)], limit=1) + [('production_id', '=', production_id), ('routing_type', '=', routing_type), + ('rfid_code', '!=', False)], limit=1) if not workorder: res = {'Succeed': False, 'ErrorCode': 202, 'Error': '该工单不存在'} return json.JSONEncoder().encode(res)