Merge branch 'leave_manage' into 'development'
Leave manage See merge request prakash.jain/cor-odoo!184
This commit is contained in:
commit
6683640989
|
@ -82,6 +82,32 @@ 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([('id', '=', 14)], limit=1)
|
||||
# #leave_calendar = self.env['hr.leave']
|
||||
# leave_calendar = self.env['hr.leave'].with_context(
|
||||
# tracking_disable=True,
|
||||
# mail_activity_automation_skip=True,
|
||||
# leave_fast_create=True,
|
||||
# leave_skip_state_check=True,
|
||||
# )
|
||||
# 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,
|
||||
# 'state': 'validate'
|
||||
# })
|
||||
# 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'
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue