update pluggin

This commit is contained in:
pawan.sharma 2021-07-08 17:43:50 +05:30
parent 633a2bbb66
commit b2f6d2bb2e
2 changed files with 20 additions and 0 deletions

View File

@ -82,6 +82,25 @@ class CompanyResourceCalendar(models.Model):
if not existing_calender:
Calendar.create(holiday)
# def action_holiday_update_timeoff_calendar(self):
# public_holiday = []
# holiday_id = self.env['hr.leave.type'].search([], limit=1)
# company = self.env['res.company'].search([], limit=1)
# employee = self.env['hr.employee'].search([], limit=1)
# leave_calendar = self.env['hr.leave']
# for comp_global_leave in self.company_global_leave_ids:
# public_holiday.append({
# 'name': "Holiday"+"/"+comp_global_leave.name,
# 'date_from': comp_global_leave.date_from,
# 'date_to': comp_global_leave.date_to,
# 'holiday_status_id': holiday_id.id,
# 'employee_id': employee.id
# })
# for holiday in public_holiday:
# existing_calender = leave_calendar.search([('date_from', '=', holiday['date_from'])])
# if not existing_calender:
# leave_calendar.create(holiday)
class CompanyResourceCalendarLeaves(models.Model):
_name = 'company.resource.calendar.leaves'

View File

@ -29,6 +29,7 @@
<header>
<button name="action_public_holiday_send" string="Send by Email" type="object" class="btn-primary"/>
<button name="action_holiday_update_calendar" string="Update Holiday Calendar" type="object" class="btn-primary"/>
<!--<button name="action_holiday_update_timeoff_calendar" string="Update Holiday Calendar" type="object" class="btn-primary"/>-->
</header>
<sheet>
<group>