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 @@ + + 计划加工时间