1.优化产品页面
2.优化agv回调接口且新增agv参数配置 3.优化工件配送
This commit is contained in:
@@ -235,7 +235,16 @@ class ResMrpWorkOrder(models.Model):
|
||||
# if not item.workpiece_code:
|
||||
# raise UserError('请对【同运工件】进行扫描')
|
||||
else:
|
||||
item.write({'task_delivery_time': fields.Datetime.now(), 'status': '待配送'})
|
||||
if item.status == '待下发':
|
||||
return {
|
||||
'name': _('确认'),
|
||||
'type': 'ir.actions.act_window',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'sf.workpiece.delivery.wizard',
|
||||
'target': 'new',
|
||||
'context': {
|
||||
'default_workorder_id': self.id,
|
||||
}}
|
||||
|
||||
# 拼接工单对象属性值
|
||||
def json_workorder_str(self, k, production, route):
|
||||
@@ -897,7 +906,25 @@ class WorkPieceDelivery(models.Model):
|
||||
|
||||
# 配送至avg小车
|
||||
def _delivery_avg(self):
|
||||
self.write({'task_delivery_time': fields.Datetime.now(), 'status': '待配送'})
|
||||
res = {'reqCode': self.production_id.name, 'reqTime': '', 'clientCode': '', 'tokenCode': '',
|
||||
'taskTyp': 'F01', 'ctnrTyp': '', 'ctnrCode': '', 'wbCode': '', 'positionCodePath': [], 'podCode': '',
|
||||
'podDir': '', 'materialLot': '', 'priority': '', 'taskCode': '', 'agvCode': '', 'materialLot': '',
|
||||
'data': ''}
|
||||
config = self.env['res.config.settings'].get_values()
|
||||
try:
|
||||
logging.info('config-AGV请求路径:%s' % config['agv_rcms_url'])
|
||||
logging.info('config-json:%s' % res)
|
||||
ret = requests.post((config['agv_rcms_url']), json=res)
|
||||
ret = ret.json()
|
||||
logging.info('config-ret:%s' % ret)
|
||||
if ret['code'] == 0:
|
||||
if self.production_id.name == ret['reqCode']:
|
||||
self.write({'task_delivery_time': fields.Datetime.now(), 'status': '待配送'})
|
||||
else:
|
||||
raise UserError(ret['message'])
|
||||
except Exception as e:
|
||||
logging.info('config-e:%s' % e)
|
||||
raise UserError("工件配送请求agv失败")
|
||||
|
||||
@api.depends('production_id.production_line_id')
|
||||
def _compute_production_line_id(self):
|
||||
|
||||
Reference in New Issue
Block a user