工作日历设置模型新增查看日历按键,隐藏工作日历菜单

This commit is contained in:
yuxianghui
2023-07-14 15:01:56 +08:00
parent 2161f4c140
commit 808f57adfb
4 changed files with 19 additions and 8 deletions

View File

@@ -184,6 +184,7 @@ class WorkLogSetting(models.Model):
'name_id': self.id,
'calendar_code': self.code,
'date_time': single_date})
@staticmethod
def daterange(start_date, end_date):
"""
@@ -193,6 +194,12 @@ class WorkLogSetting(models.Model):
for n in range(int((end_date - start_date).days)):
yield start_date + timedelta(n)
def open_work_schedule_calendar(self):
action = self.env.ref('sf_plan_management.sf_work_schedule_calendar_act')
result = action.read()[0]
result['domain'] = [('name_id', '=', self.id)]
return result
class WorkingShift(models.Model):
_name = 'sf.working.shift'