From 76597f6ccb72c1f77fea59dfd85c3d8def870c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Thu, 31 Oct 2024 11:15:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=9C=A8=E4=B8=8B=E5=8F=91=E7=BC=96?= =?UTF-8?q?=E7=A8=8B=E5=8D=95=E6=97=B6=EF=BC=8C=E5=A6=82=E6=9E=9C=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E6=8E=92=E7=A8=8B=EF=BC=8C=E5=9C=A8=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E8=B5=B7=E6=AD=A2=E6=97=B6=E9=97=B4=E6=97=B6?= =?UTF-8?q?=E5=85=88=E8=AE=BE=E7=BD=AE=E5=A4=A7=E7=9A=84=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E6=97=B6=E9=97=B4=EF=BC=8C=E9=81=BF=E5=85=8D=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index c602fd8b..571971bc 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -806,6 +806,8 @@ class MrpProduction(models.Model): 'date_to': date_planned_end, }) # work.write({'date_planned_start': date_planned_start, 'date_planned_finished': date_planned_end}) + # 设置一个较大的结束时间,防止在设置开始时间时,结束时间小于开始时间 + work.date_planned_finished = datetime.datetime.today() + datetime.timedelta(days=100) work.date_planned_start = date_planned_start work.date_planned_finished = date_planned_end routing_workcenter = self.env['mrp.routing.workcenter'].sudo().search( From 1d14ab27af01b55adcae0eaabac3d173de5be114 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Tue, 5 Nov 2024 09:50:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=AD=A6=E5=91=8A=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_maintenance/models/sf_maintenance_oee.py | 42 ++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/sf_maintenance/models/sf_maintenance_oee.py b/sf_maintenance/models/sf_maintenance_oee.py index 0889fdb5..eef42a60 100644 --- a/sf_maintenance/models/sf_maintenance_oee.py +++ b/sf_maintenance/models/sf_maintenance_oee.py @@ -62,22 +62,22 @@ class SfMaintenanceEquipmentOEE(models.Model): ("封存(报废)", "封存(报废)")], default='正常', string="机床状态", related='equipment_id.state') - online_time = fields.Char('开机时长(小时)', reaonly='True') + online_time = fields.Char('开机时长(小时)', readonly='True') - offline_time = fields.Char('关机时长(小时)', reaonly='True') - idle_nums = fields.Integer('待机次数', reaonly='True') + offline_time = fields.Char('关机时长(小时)', readonly='True') + idle_nums = fields.Integer('待机次数', readonly='True') # 待机时长 - idle_time = fields.Char('待机时长(小时)', reaonly='True') + idle_time = fields.Char('待机时长(小时)', readonly='True') # 待机率 - idle_rate = fields.Char('待机率(%)', reaonly='True') + idle_rate = fields.Char('待机率(%)', readonly='True') - work_time = fields.Char('加工时长(小时)', reaonly='True') - work_rate = fields.Char('可用率(%)', reaonly='True') - fault_time = fields.Char('故障时长(小时)', reaonly='True') - fault_rate = fields.Char('故障率(%)', reaonly='True') - fault_nums = fields.Integer('故障次数', reaonly='True') + work_time = fields.Char('加工时长(小时)', readonly='True') + work_rate = fields.Char('可用率(%)', readonly='True') + fault_time = fields.Char('故障时长(小时)', readonly='True') + fault_rate = fields.Char('故障率(%)', readonly='True') + fault_nums = fields.Integer('故障次数', readonly='True') # 设备故障日志 sf_maintenance_logs_ids = fields.One2many('sf.maintenance.logs', 'maintenance_equipment_oee_id', '设备故障日志', @@ -367,25 +367,25 @@ class SfMaintenanceEquipmentOEELog(models.Model): [("ZXJGZX", "钻铣加工中心"), ("CXJGZX", "车削加工中心"), ("FHJGZX", "复合加工中心")], default="", string="功能类型") machine_tool_picture = fields.Binary('设备图片') - type_id = fields.Many2one('sf.machine_tool.type', '品牌型号', reaonly='True') + type_id = fields.Many2one('sf.machine_tool.type', '品牌型号', readonly='True') state = fields.Selection([("加工", "加工"), ("关机", "关机"), ("待机", "待机"), ("故障", "故障"), ("检修", "检修"), ("保养", "保养")], default="", string="实时状态") - online_time = fields.Char('开机时长', reaonly='True') + online_time = fields.Char('开机时长', readonly='True') - offline_time = fields.Char('关机时长', reaonly='True') - offline_nums = fields.Integer('关机次数', reaonly='True') + offline_time = fields.Char('关机时长', readonly='True') + offline_nums = fields.Integer('关机次数', readonly='True') # 待机时长 - idle_time = fields.Char('待机时长', reaonly='True') + idle_time = fields.Char('待机时长', readonly='True') # 待机率 - idle_rate = fields.Char('待机率', reaonly='True') + idle_rate = fields.Char('待机率', readonly='True') - work_time = fields.Char('加工时长', reaonly='True') - work_rate = fields.Char('可用率', reaonly='True') - fault_time = fields.Char('故障时长', reaonly='True') - fault_rate = fields.Char('故障率', reaonly='True') - fault_nums = fields.Integer('故障次数', reaonly='True') + work_time = fields.Char('加工时长', readonly='True') + work_rate = fields.Char('可用率', readonly='True') + fault_time = fields.Char('故障时长', readonly='True') + fault_rate = fields.Char('故障率', readonly='True') + fault_nums = fields.Integer('故障次数', readonly='True') detail_ids = fields.One2many('maintenance.equipment.oee.log.detail', 'log_id', string='日志详情')