From cf34ac5bbcfae30f66e81f668ad9d68b584867dd Mon Sep 17 00:00:00 2001 From: guanhuan Date: Thu, 17 Oct 2024 16:31:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=BE=85=E5=8A=A9=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 6 ++++-- sf_manufacturing/models/mrp_workorder.py | 3 +++ sf_manufacturing/models/stock.py | 4 ++++ sf_manufacturing/views/mrp_production_addional_change.xml | 3 ++- sf_manufacturing/views/mrp_workorder_view.xml | 2 ++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index da54f77b..496c6a10 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -118,10 +118,12 @@ class MrpProduction(models.Model): ], string='工序状态', default='待装夹') # 零件图号 - part_number = fields.Char('零件图号') + part_number = fields.Char('零件图号', readonly=True) # 上传零件图纸 - part_drawing = fields.Binary('零件图纸') + part_drawing = fields.Binary('零件图纸', readonly=True) + + quality_standard = fields.Binary('质检标准', readonly=True) @api.depends('product_id.manual_quotation') def _compute_manual_quotation(self): diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index e896ca40..0ad53892 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -225,6 +225,9 @@ class ResMrpWorkOrder(models.Model): material_height = fields.Float(string='高') # 零件图号 part_number = fields.Char(related='production_id.part_number', string='零件图号') + machining_drawings = fields.Binary('2D加工图纸', related='production_id.part_drawing', readonly=True) + quality_standard = fields.Binary('质检标准', related='production_id.quality_standard', readonly=True) + # 工序状态 process_state = fields.Selection([ ('待装夹', '待装夹'), diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index daf049eb..85290d18 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -272,6 +272,10 @@ class StockRule(models.Model): if quick_easy_order: production.write({'part_number': quick_easy_order.part_drawing_number, 'part_drawing': quick_easy_order.machining_drawings}) + else: + production.write({'part_number': production.product_id.part_number, + 'part_drawing': production.product_id.machining_drawings, + 'quality_standard': production.product_id.quality_standard}) if sale_order: # sale_order.write({'schedule_status': 'to schedule'}) self.env['sf.production.plan'].sudo().with_company(company_id).create({ diff --git a/sf_manufacturing/views/mrp_production_addional_change.xml b/sf_manufacturing/views/mrp_production_addional_change.xml index 670dea7c..edfddf83 100644 --- a/sf_manufacturing/views/mrp_production_addional_change.xml +++ b/sf_manufacturing/views/mrp_production_addional_change.xml @@ -98,7 +98,8 @@ - + + diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml index ef95a934..c108e35a 100644 --- a/sf_manufacturing/views/mrp_workorder_view.xml +++ b/sf_manufacturing/views/mrp_workorder_view.xml @@ -268,6 +268,8 @@ + + 计划加工时间 From b132771c9215b2e038866ff7753f915f2a8b7aa9 Mon Sep 17 00:00:00 2001 From: guanhuan Date: Fri, 18 Oct 2024 14:32:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=BE=85=E5=8A=A9=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_dlm_management/views/product_template_management_view.xml | 4 ++-- sf_manufacturing/views/mrp_production_addional_change.xml | 4 ++-- sf_manufacturing/views/mrp_workorder_view.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sf_dlm_management/views/product_template_management_view.xml b/sf_dlm_management/views/product_template_management_view.xml index 69c1a8b0..b1083332 100644 --- a/sf_dlm_management/views/product_template_management_view.xml +++ b/sf_dlm_management/views/product_template_management_view.xml @@ -16,8 +16,8 @@ - - + + - - + + diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml index c108e35a..3af811e6 100644 --- a/sf_manufacturing/views/mrp_workorder_view.xml +++ b/sf_manufacturing/views/mrp_workorder_view.xml @@ -268,8 +268,8 @@ - - + + 计划加工时间