diff --git a/sf_maintenance/models/sf_maintenance.py b/sf_maintenance/models/sf_maintenance.py
index 7f6104ba..37da5a68 100644
--- a/sf_maintenance/models/sf_maintenance.py
+++ b/sf_maintenance/models/sf_maintenance.py
@@ -135,6 +135,7 @@ class SfMaintenanceEquipment(models.Model):
active = fields.Boolean('有效', default=True)
# 多个型号对应一个机床
machine_tool_id = fields.Many2one('sf.machine_tool', '机床')
+ sf_maintenance_logs_ids = fields.One2many('sf.maintenance.logs','maintenance_equipment_id', '设备故障日志')
def name_get(self):
diff --git a/sf_maintenance/models/sf_maintenance_logs.py b/sf_maintenance/models/sf_maintenance_logs.py
index 8c12529f..05ce3fd9 100644
--- a/sf_maintenance/models/sf_maintenance_logs.py
+++ b/sf_maintenance/models/sf_maintenance_logs.py
@@ -9,7 +9,7 @@ class SfMaintenanceLogs(models.Model):
name = fields.Char(string='名称')
type = fields.Selection([('type1', '类型1'), ('type2', '类型2')], string='类型')
brand = fields.Many2one('sf.machine.brand', relared='model.brand_id', string='品牌')
- model = fields.Many2one('maintenance.equipment', string='设备')
+ maintenance_equipment_id = fields.Many2one('maintenance.equipment', string='设备')
code_location = fields.Char(string='编码位置')
fault_type = fields.Selection([('电气类', '电气类'), ('机械类', '机械类'), ('程序类', '程序类'), ('系统类', '系统类')], string='故障类型')
fault_code = fields.Char(string='故障代码')
diff --git a/sf_maintenance/views/maintenance_logs_views.xml b/sf_maintenance/views/maintenance_logs_views.xml
index 14ddd9e0..33e22bf2 100644
--- a/sf_maintenance/views/maintenance_logs_views.xml
+++ b/sf_maintenance/views/maintenance_logs_views.xml
@@ -11,7 +11,7 @@
-
+
@@ -39,7 +39,7 @@
-
+
@@ -64,13 +64,13 @@
-
+
-
+
diff --git a/sf_maintenance/views/maintenance_views.xml b/sf_maintenance/views/maintenance_views.xml
index 8ba7e9ef..39f6a316 100644
--- a/sf_maintenance/views/maintenance_views.xml
+++ b/sf_maintenance/views/maintenance_views.xml
@@ -19,16 +19,31 @@
-
-
-
+
+
+
+
+
+
+
+
+
-
+
@@ -282,7 +297,7 @@
-