修复工件上下产线接口:当RFID不为空时,更改制造订单上下产线状态

This commit is contained in:
jinling.yang
2024-06-21 17:39:15 +08:00
parent ecf265fee7
commit de6014d1dd

View File

@@ -460,6 +460,7 @@ class Manufacturing_Connect(http.Controller):
if f'RfidCode{i}' in ret:
rfid_code = ret[f'RfidCode{i}']
logging.info('RfidCode:%s' % rfid_code)
if rfid_code is not None:
domain = [
('rfid_code', '=', rfid_code),
('routing_type', '=', 'CNC加工')
@@ -471,7 +472,8 @@ class Manufacturing_Connect(http.Controller):
logging.info(
'制造订单产线状态:%s' % order.production_id.production_line_state)
order.production_id.write({'production_line_state': '已上产线'})
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search([
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search(
[
('rfid_code', '=', rfid_code), ('type', '=', '上产线'),
('production_id', '=', order.production_id.id)])
if workpiece_delivery.status == '待下发':
@@ -515,6 +517,7 @@ class Manufacturing_Connect(http.Controller):
if f'RfidCode{i}' in ret:
rfid_code = ret[f'RfidCode{i}']
logging.info('RfidCode:%s' % rfid_code)
if rfid_code is not None:
domain = [
('rfid_code', '=', rfid_code),
('routing_type', '=', 'CNC加工')
@@ -526,7 +529,8 @@ class Manufacturing_Connect(http.Controller):
logging.info(
'制造订单产线状态:%s' % order.production_id.production_line_state)
order.production_id.write({'production_line_state': '已下产线'})
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search([
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search(
[
('rfid_code', '=', rfid_code), ('type', '=', '下产线'),
('production_id', '=', order.production_id.id)])
delivery_Arr.append(workpiece_delivery.id)