'This method will create entry in resource calendar leave object at the time of holidays validated'

@api.multi
def _create_resource_leave(self):

    for leave in self:
        self.env['resource.calendar.leaves'].create({'name': leave.name, 'date_from': leave.date_from, 'holiday_id': leave.id, 'date_to': leave.date_to, 'resource_id': leave.employee_id.resource_id.id, 'calendar_id': leave.employee_id.resource_id.calendar_id.id})
    return True
