From 28fcf5c4faa4cf39dbc5455411b298d1b6a39f41 Mon Sep 17 00:00:00 2001 From: "qihao.gong@jikimo.com" Date: Thu, 17 Aug 2023 11:11:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9C=BA=E5=9C=BA=E7=9C=8B?= =?UTF-8?q?=E6=9D=BF=E4=BB=A5=E5=8F=8A=E6=9C=BA=E5=BA=8A=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_maintenance/models/sf_maintenance.py | 1 + sf_maintenance/models/sf_maintenance_logs.py | 2 +- .../views/maintenance_logs_views.xml | 8 +++--- sf_maintenance/views/maintenance_views.xml | 25 +++++++++++++++---- 4 files changed, 26 insertions(+), 10 deletions(-) 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 @@
-
+