diff --git a/sf_manufacturing/controllers/controllers.py b/sf_manufacturing/controllers/controllers.py index 570116e9..0a5e2d0d 100644 --- a/sf_manufacturing/controllers/controllers.py +++ b/sf_manufacturing/controllers/controllers.py @@ -320,22 +320,20 @@ class Manufacturing_Connect(http.Controller): workorder = request.env['mrp.workorder'].sudo().search( [('rfid_code', '=', RfidCode)], limit=1) if not workorder: - res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未找到该工单'} + res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未根据RfidCode找到该工单'} return json.JSONEncoder().encode(res) old_localtion = request.env['sf.shelf.location'].sudo().search( [('barcode', '=', OldPosition)], limit=1) new_localtion = request.env['sf.shelf.location'].sudo().search( [('barcode', '=', NewPosition)], limit=1) if not new_localtion: - res = {'Succeed': False, 'ErrorCode': 202, 'Error': '没有该存储位置'} + res = {'Succeed': False, 'ErrorCode': 202, 'Error': '没有该目标位置'} return json.JSONEncoder().encode(res) - if workorder and old_localtion and new_localtion: + if old_localtion: old_localtion.location_status = '空闲' - new_localtion.location_status = '占用' - new_localtion.production_id = workorder.production_id.id - if old_localtion == 'None': - new_localtion.location_status = '占用' - new_localtion.production_id = workorder.production_id.id + old_localtion.production_id = False + new_localtion.location_status = '占用' + new_localtion.production_id = workorder.production_id.id # return json.JSONEncoder().encode(res) # else: # res = {'Succeed': False, 'ErrorCode': 201, 'Error': '未传RfidCode字段'} diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml index cf4fa679..15e7fd3d 100644 --- a/sf_manufacturing/views/mrp_workorder_view.xml +++ b/sf_manufacturing/views/mrp_workorder_view.xml @@ -103,7 +103,6 @@ -