From a0758b4b61f270c4929c3bf2adb64410d702777d Mon Sep 17 00:00:00 2001 From: yuxianghui <1608204036@qq.com> Date: Tue, 18 Jul 2023 14:36:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B7=A5=E4=BD=9C=E6=97=A5?= =?UTF-8?q?=E5=8E=86=E8=AE=BE=E7=BD=AE=E7=9A=84=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_plan_management/models/calendar_base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sf_plan_management/models/calendar_base.py b/sf_plan_management/models/calendar_base.py index 545c3b7c..d67842e8 100644 --- a/sf_plan_management/models/calendar_base.py +++ b/sf_plan_management/models/calendar_base.py @@ -137,12 +137,14 @@ class WorkLogSetting(models.Model): # end_date = start_date + timedelta(days=365) # 结束日期 # 获取本年第一天和最后一天 start_date = datetime.now().replace(month=1, day=1).date() - end_date = datetime.now().replace(month=12, day=31).date() + end_date = datetime.now().replace(month=1, day=31).date() logging.info(f'start_date: {start_date} , end_date: {end_date}') # 休息日列表 rest_days = self.day_off_ids.mapped('name') + logging.info(f'获取界面输入的休息日:{rest_days}') for single_date in self.daterange(start_date, end_date): is_workday = single_date.strftime("%A") + logging.info(f'获取一月份每天的星期:{is_workday}') if is_workday in rest_days: print('is_workday in rest_days', is_workday) self.env['sf.work.schedule.calendar'].sudo().create({