AGV增加运行日志

设备oee增加运行日志
This commit is contained in:
qihao.gong@jikimo.com
2024-01-24 17:29:42 +08:00
parent 0ef13504e7
commit fc7c66c615
5 changed files with 159 additions and 71 deletions

View File

@@ -23,6 +23,7 @@ class SfMaintenanceEquipmentOEE(models.Model):
fault_nums = fields.Integer('故障次数')
sf_maintenance_logs_ids = fields.One2many('sf.maintenance.logs', 'maintenance_equipment_oee_id', '设备故障日志',
related='equipment_id.sf_maintenance_logs_ids')
oee_logs = fields.One2many('maintenance.equipment.oee.logs', 'equipment_oee_id', string='运行日志')
def name_get(self):
result = []
@@ -30,4 +31,19 @@ class SfMaintenanceEquipmentOEE(models.Model):
if parameter.equipment_id:
name = parameter.equipment_id.name
result.append((parameter.id, name))
return result
return result
class SfMaintenanceEquipmentOEELog(models.Model):
_name = 'maintenance.equipment.oee.logs'
_description = '设备运行日志'
name = fields.Char('运行日志')
run_time = fields.Datetime('时间')
state = fields.Selection([("开机", "开机"), ("关机", "关机"), ("等待", "等待"), ("开始加工", "开始加工"),
("结束加工", "结束加工"), ("故障", "故障"),
("检修", "检修"), ("保养", "保养")], default="", string="事件/状态")
workorder_id = fields.Char('加工订单')
time = fields.Char('持续时长')
color = fields.Char('颜色', default=1)
equipment_oee_id = fields.Many2one('maintenance.equipment.oee', '设备OEE')