From 9efb13cf01df1ac5a474be5e91fdbc96bd62d6e5 Mon Sep 17 00:00:00 2001 From: hujiaying Date: Sat, 14 Sep 2024 16:34:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=92=E7=A8=8B=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E5=BC=80=E5=A7=8B=E6=97=B6=E9=97=B4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_plan/wizard/action_plan_some.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sf_plan/wizard/action_plan_some.py b/sf_plan/wizard/action_plan_some.py index a508dfb2..1900e14e 100644 --- a/sf_plan/wizard/action_plan_some.py +++ b/sf_plan/wizard/action_plan_some.py @@ -15,10 +15,15 @@ class Action_Plan_All_Wizard(models.TransientModel): _name = 'sf.action.plan.all.wizard' _description = u'排程向导' + def _get_date_planned_start(self): + planned_start_date = datetime.now() + timedelta(minutes=10) + logging.info('计划开始时间: %s', planned_start_date) + return planned_start_date + # 选择生产线 production_line_id = fields.Many2one('sf.production.line', string=u'生产线', required=True) date_planned_start = fields.Datetime(string='计划开始时间', index=True, copy=False, - default=datetime.now() + timedelta(minutes=10)) + default=_get_date_planned_start) # 接收传递过来的计划ID plan_ids = fields.Many2many('sf.production.plan', string=u'计划ID')