ljm 企业微信 扫码登陆 居中
This commit is contained in:
@@ -16,6 +16,21 @@ class ResourceCalendar(models.Model):
|
||||
string="部门",
|
||||
domain="[('company_id', 'in', allowed_company_ids)]"
|
||||
)
|
||||
card_start_time = fields.Float(string="打卡开始时间")
|
||||
card_end_time = fields.Float(string="打卡结束时间")
|
||||
employee_ids = fields.One2many('hr.employee', 'user_id', string='打卡白名单')
|
||||
elasticity_work_time = fields.Boolean(string="弹性上下班")
|
||||
allow_late_early = fields.Boolean(string="允许迟到早退")
|
||||
go_allow_late = fields.Float(string="上班允许迟到")
|
||||
go_allow_early = fields.Float(string="下班允许早退")
|
||||
allow_late_early_leave = fields.Boolean(string="允许早到早走, 晚到晚走")
|
||||
leave_allow_early = fields.Float(string="最多早到早走")
|
||||
leave_allow_late = fields.Float(string="最多晚到晚走")
|
||||
|
||||
allow_late_early_work = fields.Boolean(string="允许下班晚走次日晚到")
|
||||
work_late = fields.Float(string="下班晚走")
|
||||
work_after = fields.Float(string="次日可晚到")
|
||||
|
||||
|
||||
def get_baidu_holiday(self):
|
||||
"""
|
||||
@@ -77,16 +92,24 @@ class ResourceCalendar(models.Model):
|
||||
datetime.strptime(date, "%Y-%m-%d")]
|
||||
holidays_dic[holiday][1] = datetime.strptime(date, "%Y-%m-%d")
|
||||
holiday_list = []
|
||||
leave_list = []
|
||||
for holiday, time in holidays_dic.items():
|
||||
holiday_values = {
|
||||
'holiday_type': holiday,
|
||||
'calendar_start_time': time[0] - timedelta(hours=8),
|
||||
'calendar_end_time': time[1].replace(hour=15, minute=59, second=59),
|
||||
}
|
||||
leave_values = {
|
||||
'name': holiday,
|
||||
'date_from': time[0] - timedelta(hours=8),
|
||||
'date_to': time[1].replace(hour=15, minute=59, second=59),
|
||||
}
|
||||
holiday_list.append((0, 0, holiday_values))
|
||||
leave_list.append((0, 0, leave_values))
|
||||
self.calendar_holiday_ids.unlink()
|
||||
self.holiday_data_lines = holiday_list
|
||||
self.write({'calendar_holiday_ids': holiday_list})
|
||||
self.write({'global_leave_ids': leave_list})
|
||||
|
||||
|
||||
class ResourceCalendarHolidaye(models.Model):
|
||||
|
||||
Reference in New Issue
Block a user