增加AGV调度功能,工单页面增加自定义筛选字段

This commit is contained in:
胡尧
2024-08-07 17:44:43 +08:00
parent 8ec5e05739
commit 5d8f0f83b2
14 changed files with 167 additions and 6 deletions

View File

@@ -11,12 +11,14 @@ class AgvSetting(models.Model):
_description = 'agv站点'
name = fields.Char('位置编号')
owning_region = fields.Char('所属区域')
# owning_region = fields.Char('所属区域')
state = fields.Selection([
('占用', '占用'),
('空闲', '空闲')], string='状态')
divide_the_work = fields.Char('主要分工')
active = fields.Boolean('有效', default=True)
region = fields.Many2one(string='所属区域', comodel_name='mrp.workcenter', tracking=True,
domain=[('is_agv_dispatch', '=', True)])
def update_site_state(self):
# 调取中控的接驳站接口并修改对应站点的状态
@@ -71,6 +73,15 @@ class AgvTaskRoute(models.Model):
if self.end_site_id == self.start_site_id:
raise UserError("您选择的终点接驳站与起点接驳站重复,请重新选择")
region = fields.Many2one(string='所属区域', comodel_name='mrp.workcenter', domain=[('is_agv_dispatch', '=', True)],
compute="_compute_region")
@api.depends('end_site_id')
def _compute_region(self):
for record in self:
if record.end_site_id:
record.region = record.end_site_id.region
class Center_controlInterfaceLog(models.Model):
_name = 'center_control.interface.log'