From 82f54b5d830888ac9154daa35e5afd95648a78d1 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Wed, 24 Jan 2024 14:24:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=96=B0=E5=A2=9E=E7=94=9F=E4=BA=A7=E7=BA=BF=E5=92=8C?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=BC=80=E5=A7=8B=E5=8A=A0=E5=B7=A5=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 11 - sf_manufacturing/models/mrp_workorder.py | 2 +- .../views/mrp_production_addional_change.xml | 329 ++++++++++-------- sf_manufacturing/views/mrp_workorder_view.xml | 9 +- sf_plan/models/custom_plan.py | 38 +- sf_plan/views/change_manufactuing.xml | 110 +++--- sf_plan/views/view.xml | 230 +++++------- 7 files changed, 359 insertions(+), 370 deletions(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 7bf0886f..61be5b40 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -50,18 +50,7 @@ class MrpProduction(models.Model): work_state = fields.Char('业务状态') programming_state = fields.Char('编程状态') glb_file = fields.Binary("glb模型文件") - production_line_id = fields.Many2one('sf.production.line', string='生产线', compute='_compute_production_line_id', - store=True) - plan_start_processing_time = fields.Datetime('计划开始加工时间') - @api.depends('name') - def _compute_production_line_id(self): - for production in self: - if production.name: - plan_production = self.env['sf.production.plan'].search([('production_id', '=', self.id)]) - if plan_production: - production.production_line_id = plan_production.production_id.id - production.plan_start_processing_time = plan_production.date_planned_start @api.depends( 'move_raw_ids.state', 'move_raw_ids.quantity_done', 'move_finished_ids.state', diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 04f49d0a..7a77fc5c 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -777,7 +777,7 @@ class WorkPieceDelivery(models.Model): workorder_id = fields.Many2one('mrp.workorder', string='工单', domain=[('name', 'in', ('装夹', '解除装夹'))]) - name = fields.Char(related='workorder_id.production_id.name', string='工件编码/任务编码', store=True) + production_code = fields.Char(related='workorder_id.production_id.name', string='工件编码/任务编码', store=True) plan_start_processing_time = fields.Datetime('计划开始加工时间') workpiece_code = fields.Char('同运工件编码') feeder_station_start = fields.Char('起点接驳站') diff --git a/sf_manufacturing/views/mrp_production_addional_change.xml b/sf_manufacturing/views/mrp_production_addional_change.xml index 5c7f9cc0..e45f4a6e 100644 --- a/sf_manufacturing/views/mrp_production_addional_change.xml +++ b/sf_manufacturing/views/mrp_production_addional_change.xml @@ -18,19 +18,21 @@ - + - + - + - - - + + + @@ -39,44 +41,52 @@ + attrs="{'invisible': [('state', 'not in', ['confirmed', 'progress'])]}" + optional="hide" + decoration-success="reservation_state == 'assigned' or components_availability_state == 'available'" + decoration-warning="reservation_state != 'assigned' and components_availability_state in ('expected', 'available')" + decoration-danger="reservation_state != 'assigned' and components_availability_state == 'late'"/> - - - - + + + + - - + + custom.mrp.production.form mrp.production - draft,confirmed,progress,pending_processing,completed,done + draft,confirmed,progress,pending_processing,completed,done + - + - +