From 5b084624dfd9ff10701ae0bab80fa275369e5bf4 Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Wed, 12 Mar 2025 13:46:07 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=B8=8D=E9=80=81=E6=A3=80=E7=9A=84?= =?UTF-8?q?=E8=B4=A8=E9=87=8F=E6=A3=80=E6=9F=A5=E5=8D=95=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=9A=E7=AD=89=E5=BE=85=E3=80=81=E5=BE=85?= =?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_manufacturing/models/mrp_workorder.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index c0c45ac8..4a5d0c0f 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -1198,11 +1198,7 @@ class ResMrpWorkOrder(models.Model): 'cmm_ids': production.workorder_ids.filtered(lambda t: t.routing_type == 'CNC加工').cmm_ids, }] return workorders_values_str - - @api.depends('production_availability', 'blocked_by_workorder_ids', 'blocked_by_workorder_ids.state', - 'production_id.tool_state', 'production_id.schedule_state', 'sequence', - 'production_id.programming_state') - def _compute_state(self): + def _process_compute_state(self): for workorder in self: # 如果工单的工序没有进行排序则跳出循环 if workorder.production_id.workorder_ids.filtered(lambda wk: wk.sequence == 0): @@ -1289,7 +1285,20 @@ class ResMrpWorkOrder(models.Model): mo.get_move_line(workorder.production_id, workorder)) else: workorder.state = 'waiting' - + @api.depends('production_availability', 'blocked_by_workorder_ids', 'blocked_by_workorder_ids.state', + 'production_id.tool_state', 'production_id.schedule_state', 'sequence', + 'production_id.programming_state') + def _compute_state(self): + self._process_compute_state() + for workorder in self: + if workorder.state == 'waiting' or workorder.state == 'pending': + for check_id in workorder.check_ids: + if not check_id.is_inspect: + check_id.quality_state = 'waiting' + if workorder.state == 'ready': + for check_id in workorder.check_ids: + if not check_id.is_inspect: + check_id.quality_state = 'none' # 重写工单开始按钮方法 def button_start(self): # 判断工单状态是否为等待组件 From 7c48e6b186147cac62946c15584b1ed02eb2eae5 Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Thu, 13 Mar 2025 09:49:17 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=90=8C=E4=B8=80=E4=B8=AA=E9=94=80?= =?UTF-8?q?=E5=94=AE=E8=AE=A2=E5=8D=95=E7=9A=84=E4=B8=8D=E5=90=8C=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E7=9A=84=E5=9D=AF=E6=96=99=E8=8E=B7=E5=8F=96=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E4=B8=8D=E4=B8=80=E6=A0=B7=EF=BC=8C=E7=94=9F=E6=88=90?= =?UTF-8?q?=E7=9A=84=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95=E9=97=AE=E9=A2=98?= 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, 1 insertion(+), 1 deletion(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index f8a22b28..433feccc 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -1574,7 +1574,7 @@ class MrpProduction(models.Model): vals['picking_type_id'] = picking_type_id vals['name'] = self.env['stock.picking.type'].browse(picking_type_id).sequence_id.next_by_id() product_id = self.env['product.product'].browse(vals['product_id']) - is_self_process = product_id.materials_type_id and product_id.materials_type_id.gain_way and product_id.materials_type_id.gain_way != '自加工' + is_self_process = product_id.materials_type_id.gain_way if product_id.materials_type_id else None is_customer_provided = product_id.is_customer_provided key = f"{is_self_process}_{is_customer_provided}" if not is_custemer_group_id.get(key): From 83699fcae625f37f433625cb43a9ca1b5f572994 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Thu, 13 Mar 2025 11:11:22 +0800 Subject: [PATCH 3/3] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E8=B4=A8?= =?UTF-8?q?=E6=A3=80=E6=8F=90=E7=A4=BA=E7=BF=BB=E8=AF=91=EF=BC=9B2?= =?UTF-8?q?=E3=80=81=E5=A4=84=E7=90=86=E5=8D=95=E6=8D=AE=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E5=8E=9F=E5=8D=95=E6=8D=AE=E6=95=B0=E6=8D=AE=E4=B8=8D=E5=85=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=9B3=E3=80=81=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95=E8=BF=94=E5=B7=A5=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quality_control/wizard/quality_check_wizard.py | 3 ++- sf_manufacturing/models/stock.py | 2 ++ sf_manufacturing/wizard/rework_wizard.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/quality_control/wizard/quality_check_wizard.py b/quality_control/wizard/quality_check_wizard.py index 1317236d..3c67eb87 100644 --- a/quality_control/wizard/quality_check_wizard.py +++ b/quality_control/wizard/quality_check_wizard.py @@ -62,7 +62,8 @@ class QualityCheckWizard(models.TransientModel): def do_pass(self): if self.test_type == 'picture' and not self.picture: - raise UserError('You must provide a picture before validating') + raise UserError('请先上传照片') + # raise UserError('You must provide a picture before validating') self.current_check_id.do_pass() return self.action_generate_next_window() diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index 30485988..02018a11 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -1032,6 +1032,8 @@ class ReStockMove(models.Model): productions = self.env['mrp.production'].search( [('origin', '=', production.origin), ('product_id', '=', production.product_id.id)]) res['origin'] = ','.join(productions.mapped('name')) + if self.picking_type_id.name == '客供料入库': + self.picking_id.sudo().write({'origin': res['origin'] if res.get('origin') else self[0].picking_id.origin}) return res def _get_new_picking_values(self): diff --git a/sf_manufacturing/wizard/rework_wizard.py b/sf_manufacturing/wizard/rework_wizard.py index 11827819..6061dda8 100644 --- a/sf_manufacturing/wizard/rework_wizard.py +++ b/sf_manufacturing/wizard/rework_wizard.py @@ -140,7 +140,7 @@ class ReworkWizard(models.TransientModel): and item.process_parameters_id == work.surface_technics_parameters_id) or (item.route_id.name == work.name and item.panel and item.panel == work.processing_panel) or - (item.route_id == work.routing_workcenter_id + (item.route_id == work.routing_work_center_id and not work.processing_panel and not work.surface_technics_parameters_id)) if route: