From e9e25c582e89cdec9f8121db9dd66e041b9bed98 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Thu, 21 Sep 2023 14:32:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=92=E7=A8=8B=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E5=8F=8D=E9=A6=88=E7=BB=99=E5=88=B6=E9=80=A0=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/views/mrp_production_addional_change.xml | 3 +++ sf_plan/models/custom_plan.py | 8 ++++++-- sf_plan/views/view.xml | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sf_manufacturing/views/mrp_production_addional_change.xml b/sf_manufacturing/views/mrp_production_addional_change.xml index b326f288..186ebc1c 100644 --- a/sf_manufacturing/views/mrp_production_addional_change.xml +++ b/sf_manufacturing/views/mrp_production_addional_change.xml @@ -28,6 +28,9 @@ + + + diff --git a/sf_plan/models/custom_plan.py b/sf_plan/models/custom_plan.py index 15af211a..064a1e20 100644 --- a/sf_plan/models/custom_plan.py +++ b/sf_plan/models/custom_plan.py @@ -180,9 +180,11 @@ class sf_production_plan(models.Model): print(workorder_time) self.date_planned_finished = self.date_planned_start + timedelta(minutes=workorder_time) self.state = 'done' + aa.schedule_state = '已排' else: - self.date_planned_finished = self.date_planned_start + timedelta(days=3) - self.state = 'done' + raise ValidationError("未找到工单") + # self.date_planned_finished = self.date_planned_start + timedelta(days=3) + # self.state = 'done' return { 'name': '排程甘特图', 'type': 'ir.actions.act_window', @@ -224,6 +226,8 @@ class sf_production_plan(models.Model): def cancel_production_schedule(self): self.date_planned_finished = False self.state = 'draft' + aa = self.env['mrp.production'].sudo().search([('name', '=', self.name)]) + aa.schedule_state = '未排' return self.date_planned_finished def liucheng_cs(self): diff --git a/sf_plan/views/view.xml b/sf_plan/views/view.xml index f7c22624..49a42c5f 100644 --- a/sf_plan/views/view.xml +++ b/sf_plan/views/view.xml @@ -31,7 +31,7 @@
-