diff --git a/sf_manufacturing/controllers/controllers.py b/sf_manufacturing/controllers/controllers.py index 6ef8a38e..b9027a9f 100644 --- a/sf_manufacturing/controllers/controllers.py +++ b/sf_manufacturing/controllers/controllers.py @@ -470,7 +470,7 @@ class Manufacturing_Connect(http.Controller): '制造订单产线状态:%s' % order.production_id.production_line_state) order.production_id.write({'production_line_state': '已上产线'}) workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search([ - ('rfid_code', '=', rfid_code), + ('rfid_code', '=', rfid_code), ('type', '=', '上产线'), ('production_id', '=', order.production_id.id)]) if workpiece_delivery.status == '待下发': workpiece_delivery.write({'is_manual_work': True}) @@ -525,7 +525,7 @@ class Manufacturing_Connect(http.Controller): '制造订单产线状态:%s' % order.production_id.production_line_state) order.production_id.write({'production_line_state': '已下产线'}) workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search([ - ('rfid_code', '=', rfid_code), + ('rfid_code', '=', rfid_code), ('type', '=', '下产线'), ('production_id', '=', order.production_id.id)]) delivery_Arr.append(workpiece_delivery.id) else: diff --git a/sf_manufacturing/models/agv_setting.py b/sf_manufacturing/models/agv_setting.py index a0a14d3d..64af1d90 100644 --- a/sf_manufacturing/models/agv_setting.py +++ b/sf_manufacturing/models/agv_setting.py @@ -27,7 +27,7 @@ class AgvSetting(models.Model): center_control_url += str(timestamp) logging.info('工件配送-请求中控地址:%s' % center_control_url) try: - center_control_r = requests.get(center_control_url, headers=headers, timeout=60) # 设置超时为60秒 + center_control_r = requests.get(center_control_url, headers=headers, timeout=10) # 设置超时为60秒 ret = center_control_r.json() logging.info('工件配送-请求中控站点信息:%s' % ret) self.env['center_control.interface.log'].sudo().create( diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index d8a5f41f..6874dd22 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -492,7 +492,7 @@ class StockPicking(models.Model): # 设置外协出入单的名称 def _get_name_Res(self, rescode): - last_picking = self.sudo().search([('name', 'like', rescode)], order='create_date DESC', limit=1) + last_picking = self.sudo().search([('name', 'like', rescode)], order='create_date desc,id desc', limit=1) if not last_picking: num = "%04d" % 1 else: