From 76597f6ccb72c1f77fea59dfd85c3d8def870c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Thu, 31 Oct 2024 11:15:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E4=B8=8B=E5=8F=91=E7=BC=96=E7=A8=8B?= =?UTF-8?q?=E5=8D=95=E6=97=B6=EF=BC=8C=E5=A6=82=E6=9E=9C=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E6=8E=92=E7=A8=8B=EF=BC=8C=E5=9C=A8=E4=BF=AE=E6=94=B9=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E8=B5=B7=E6=AD=A2=E6=97=B6=E9=97=B4=E6=97=B6=E5=85=88?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=A4=A7=E7=9A=84=E7=BB=93=E6=9D=9F=E6=97=B6?= =?UTF-8?q?=E9=97=B4=EF=BC=8C=E9=81=BF=E5=85=8D=E8=AE=BE=E7=BD=AE=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=87=BA=E9=94=99?= 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, 2 insertions(+) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index c602fd8b..571971bc 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -806,6 +806,8 @@ class MrpProduction(models.Model): 'date_to': date_planned_end, }) # work.write({'date_planned_start': date_planned_start, 'date_planned_finished': date_planned_end}) + # 设置一个较大的结束时间,防止在设置开始时间时,结束时间小于开始时间 + work.date_planned_finished = datetime.datetime.today() + datetime.timedelta(days=100) work.date_planned_start = date_planned_start work.date_planned_finished = date_planned_end routing_workcenter = self.env['mrp.routing.workcenter'].sudo().search(