修改库位变更接口
This commit is contained in:
@@ -317,6 +317,8 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
NewPosition = ret['NewPosition']
|
NewPosition = ret['NewPosition']
|
||||||
OldDeciveStart = ret['OldDeciveStart']
|
OldDeciveStart = ret['OldDeciveStart']
|
||||||
OldDeciveEnd = ret['OldDeciveEnd']
|
OldDeciveEnd = ret['OldDeciveEnd']
|
||||||
|
# Part、Tool
|
||||||
|
if ChangeType == 'Part':
|
||||||
workorder = request.env['mrp.workorder'].sudo().search(
|
workorder = request.env['mrp.workorder'].sudo().search(
|
||||||
[('rfid_code', '=', RfidCode)], limit=1)
|
[('rfid_code', '=', RfidCode)], limit=1)
|
||||||
if not workorder:
|
if not workorder:
|
||||||
@@ -334,6 +336,20 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
old_localtion.production_id = False
|
old_localtion.production_id = False
|
||||||
new_localtion.location_status = '占用'
|
new_localtion.location_status = '占用'
|
||||||
new_localtion.production_id = workorder.production_id.id
|
new_localtion.production_id = workorder.production_id.id
|
||||||
|
if ChangeType == 'Tool':
|
||||||
|
old_localtion = request.env['sf.shelf.location'].sudo().search(
|
||||||
|
[('barcode', '=', OldPosition)], limit=1)
|
||||||
|
equipment_id = request.env['maintenance.equipment'].sudo().search(
|
||||||
|
[('name', '=', NewPosition)], limit=1)
|
||||||
|
equipment_id.register_equipment_tool()
|
||||||
|
if not new_localtion:
|
||||||
|
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '没有该目标位置'}
|
||||||
|
return json.JSONEncoder().encode(res)
|
||||||
|
if old_localtion:
|
||||||
|
old_localtion.location_status = '空闲'
|
||||||
|
old_localtion.production_id = False
|
||||||
|
|
||||||
|
|
||||||
# return json.JSONEncoder().encode(res)
|
# return json.JSONEncoder().encode(res)
|
||||||
# else:
|
# else:
|
||||||
# res = {'Succeed': False, 'ErrorCode': 201, 'Error': '未传RfidCode字段'}
|
# res = {'Succeed': False, 'ErrorCode': 201, 'Error': '未传RfidCode字段'}
|
||||||
|
|||||||
Reference in New Issue
Block a user