From 7502792438639a6f13381ab7255e3c954d08c155 Mon Sep 17 00:00:00 2001 From: hujiaying Date: Sat, 14 Sep 2024 17:26:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A1=E5=88=92=E6=8E=92?= =?UTF-8?q?=E7=A8=8B=E5=88=97=E8=A1=A8=E8=BF=9B=E5=85=A5=E5=BE=85=E6=8E=92?= =?UTF-8?q?=E7=A8=8B=E7=9A=84=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E8=BF=9B=E8=A1=8C=E6=8E=92=E7=A8=8B-=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_plan/models/custom_plan.py | 6 ++---- sf_plan/wizard/action_plan_some.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sf_plan/models/custom_plan.py b/sf_plan/models/custom_plan.py index c4043d33..05ebf034 100644 --- a/sf_plan/models/custom_plan.py +++ b/sf_plan/models/custom_plan.py @@ -191,7 +191,7 @@ class sf_production_plan(models.Model): return num - def do_production_schedule(self, date_planned_start): + def do_production_schedule(self): """ 排程方法 """ @@ -199,8 +199,7 @@ class sf_production_plan(models.Model): if not record.production_line_id: raise ValidationError("未选择生产线") else: - - is_schedule = self.deal_processing_schedule(date_planned_start) + is_schedule = self.deal_processing_schedule(record.date_planned_start) if not is_schedule: raise ValidationError("排程失败") workorder_id_list = record.production_id.workorder_ids.ids @@ -209,7 +208,6 @@ class sf_production_plan(models.Model): for item in record.production_id.workorder_ids: if item.name == 'CNC加工': item.date_planned_finished = datetime.now() + timedelta(days=100) - # item.date_planned_start = record.date_planned_start item.date_planned_start = self.date_planned_start if self.date_planned_start else datetime.now() record.sudo().production_id.plan_start_processing_time = item.date_planned_start item.date_planned_finished = item.date_planned_start + timedelta( diff --git a/sf_plan/wizard/action_plan_some.py b/sf_plan/wizard/action_plan_some.py index 1900e14e..52b9a249 100644 --- a/sf_plan/wizard/action_plan_some.py +++ b/sf_plan/wizard/action_plan_some.py @@ -42,7 +42,7 @@ class Action_Plan_All_Wizard(models.TransientModel): plan_obj = self.env['sf.production.plan'].browse(plan.id) plan_obj.production_line_id = self.production_line_id.id plan.date_planned_start = self.date_planned_start - plan_obj.do_production_schedule(self.date_planned_start) + plan_obj.do_production_schedule() # plan_obj.state = 'done' print('处理计划:', plan.id, '完成')