agv调度开发
This commit is contained in:
@@ -650,6 +650,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
'production_id': self.production_id.id,
|
||||
'production_line_id': self.production_id.production_line_id.id,
|
||||
'type': '上产线',
|
||||
'is_cnc_program_down': True
|
||||
# 'route_id': up_route.id,
|
||||
# 'feeder_station_start_id': agv_start_site_id,
|
||||
# 'feeder_station_destination_id': up_route.end_site_id.id
|
||||
@@ -1254,7 +1255,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
button_element = etree.Element('button', {
|
||||
'name': 'button_delivery',
|
||||
'type': 'object',
|
||||
'string': '拆卸',
|
||||
'string': '解除装夹',
|
||||
'class': 'btn-primary',
|
||||
# 'className': 'btn-primary',
|
||||
'modifiers': '{"force_show": 1}'
|
||||
@@ -1290,7 +1291,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
'default_delivery_type': delivery_type,
|
||||
'default_workorder_ids': [(6, 0, workorder_ids)],
|
||||
'default_workcenter_id': self.env.context.get('default_workcenter_id'),
|
||||
'default_confirm_button': '确认拆卸'
|
||||
'default_confirm_button': '确认解除'
|
||||
}}
|
||||
|
||||
|
||||
@@ -1580,12 +1581,14 @@ class WorkPieceDelivery(models.Model):
|
||||
delivery_duration = fields.Float('配送时长', compute='_compute_delivery_duration')
|
||||
status = fields.Selection(
|
||||
[('待下发', '待下发'), ('已下发', '已下发'), ('已配送', '已配送'), ('已取消', '已取消')], string='状态',
|
||||
default='待下发',
|
||||
tracking=True)
|
||||
default='待下发', tracking=True)
|
||||
is_cnc_program_down = fields.Boolean('程序是否下发', default=False, tracking=True)
|
||||
is_manual_work = fields.Boolean('人工操作', default=False)
|
||||
active = fields.Boolean(string="有效", default=True)
|
||||
|
||||
agv_scheduling_id = fields.Many2one('sf.agv.scheduling', 'AGV任务调度')
|
||||
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
if vals.get('route_id') and vals.get('type') is None:
|
||||
@@ -1634,7 +1637,7 @@ class WorkPieceDelivery(models.Model):
|
||||
|
||||
# 工件配送
|
||||
def button_delivery(self):
|
||||
# delivery_ids = []
|
||||
delivery_ids = []
|
||||
production_ids = []
|
||||
workorder_ids = []
|
||||
is_cnc_down = 0
|
||||
@@ -1654,7 +1657,7 @@ class WorkPieceDelivery(models.Model):
|
||||
if item.is_cnc_program_down is False:
|
||||
is_cnc_down += 1
|
||||
if is_cnc_down == 0 and is_not_production_line == 0:
|
||||
# delivery_ids.append(item.id)
|
||||
delivery_ids.append(item.id)
|
||||
production_ids.append(item.production_id.id)
|
||||
workorder_ids.append(item.workorder_id.id)
|
||||
if is_cnc_down >= 1:
|
||||
@@ -1668,7 +1671,7 @@ class WorkPieceDelivery(models.Model):
|
||||
'res_model': 'sf.workpiece.delivery.wizard',
|
||||
'target': 'new',
|
||||
'context': {
|
||||
# 'default_delivery_ids': [(6, 0, delivery_ids)],
|
||||
'default_delivery_ids': [(6, 0, delivery_ids)],
|
||||
'default_production_ids': [(6, 0, production_ids)],
|
||||
'default_delivery_type': delivery_type,
|
||||
'default_workorder_ids': [(6, 0, workorder_ids)],
|
||||
|
||||
Reference in New Issue
Block a user