From 8e788d3745525f44b4ed77bf89263c5e3794d4d3 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Mon, 20 Jan 2025 14:18:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86CNC=E5=8A=A0=E5=B7=A5?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E9=80=9A=E8=BF=87=E6=8E=A5=E5=8F=A3=E4=B8=8A?= =?UTF-8?q?=E4=BA=A7=E7=BA=BF=E4=B8=8B=E4=BA=A7=E7=BA=BF=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E4=B8=BA=E5=BE=85=E6=A3=80=E6=B5=8B=E6=97=B6=EF=BC=8C=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E8=B4=A8=E6=A3=80=E5=8D=95=E8=BF=98=E6=98=AF=E7=AD=89?= =?UTF-8?q?=E5=BE=85=E7=8A=B6=E6=80=81=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_workorder.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 1980ae1a..b0615197 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -1543,7 +1543,15 @@ class ResMrpWorkOrder(models.Model): # 修改工单状态 self.write({'state': 'to be detected'}) # 若关联的【质量检查_需送检】=true,则质量检查单的状态从“等待”更新为“待处理” - self.check_ids.filtered(lambda ch: ch.is_inspect is True).write({'quality_state': 'none'}) + self.check_ids.filtered(lambda ch: ch.is_inspect is True and ch.quality_state == 'waiting').write( + {'quality_state': 'none'}) + + @api.onchange('state') + def _onchange_state_quality(self): + for wm in self: + if wm.routing_type == 'CNC加工' and wm.state == 'to be detected' and wm.check_ids: + wm.check_ids.filtered(lambda ch: ch.is_inspect is True and ch.quality_state == 'waiting').write( + {'quality_state': 'none'}) class CNCprocessing(models.Model):