解决工作日历无法创建的bug

This commit is contained in:
mgw
2023-07-14 14:35:22 +08:00
parent 14283ab5e4
commit 3de5a95a98

View File

@@ -179,7 +179,7 @@ class WorkLogSetting(models.Model):
is_workday = single_date.strftime("%A")
if is_workday in rest_days:
print('is_workday in rest_days', is_workday)
self.env['sf.work.schedule.calendar'].create({
self.env['sf.work.schedule.calendar'].sudo().create({
'name': '休息日',
'name_id': self.id,
'calendar_code': self.code,