From b5147678b125702e084efca817a5e425775f10cd Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Wed, 10 Jan 2024 12:20:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=92=E7=A8=8B=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=B7=A5=E5=8D=95=E6=97=B6=E9=97=B4=E6=9C=AA=E7=94=9F?= =?UTF-8?q?=E6=88=90=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_plan/models/custom_plan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sf_plan/models/custom_plan.py b/sf_plan/models/custom_plan.py index 03117a3a..96e98773 100644 --- a/sf_plan/models/custom_plan.py +++ b/sf_plan/models/custom_plan.py @@ -220,7 +220,7 @@ class sf_production_plan(models.Model): """ sequence = workorder_id_list.index(item.id) - 1 # 计算CNC加工之前工单的开始结束时间 - for i in range(sequence): + for i in range(1 if sequence == 0 else sequence): current_workorder_id = (item.id - (i + 1)) current_workorder_obj = self.env['mrp.workorder'].sudo().search( [('id', '=', current_workorder_id)])