新增工作日历设置的日志
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user