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)