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 1/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='日志详情') From 106945fba7ab956626b59bff671df3a97b439fd6 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Wed, 6 Nov 2024 09:23:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_sale/models/sale_order.py | 2 ++ sf_sale/views/purchase_order_view.xml | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/sf_sale/models/sale_order.py b/sf_sale/models/sale_order.py index 53f73aef..3f2aa5f9 100644 --- a/sf_sale/models/sale_order.py +++ b/sf_sale/models/sale_order.py @@ -208,6 +208,8 @@ class RePurchaseOrder(models.Model): compute='_compute_user_id', store=True) + purchase_type = fields.Selection([('standard', '标准采购'), ('consignment', '委外加工')], string='采购类型', default='standard') + @api.depends('partner_id') def _compute_user_id(self): if not self.user_id: diff --git a/sf_sale/views/purchase_order_view.xml b/sf_sale/views/purchase_order_view.xml index f721d515..0a66287f 100644 --- a/sf_sale/views/purchase_order_view.xml +++ b/sf_sale/views/purchase_order_view.xml @@ -158,6 +158,11 @@ {'readonly': [('state', 'in', ['purchase'])]} + + + + +