[IMP]company wise job recruitment details.

bzr revid: bth@tinyerp.com-20130808133559-0215szr2yjwplp9v
This commit is contained in:
bth-openerp 2013-08-08 19:05:59 +05:30
parent bed908a057
commit 0e52892802
2 changed files with 30 additions and 23 deletions

View File

@ -11,9 +11,13 @@ class website_hr_recruitment(http.Controller):
def career(self, **post):
website = request.registry['website']
jobpost_ids = request.registry['hr.job'].search(request.cr, request.uid, [("state", "=", 'open')])
#groups = request.registry['hr.job'].read_group(request.cr, request.uid, [], [], ['company_id'])
#print "\n\n>>>>..grouos>>>>>>>>>>",groups
request.cr.execute("select distinct(com.id) from hr_job job, res_company com where com.id=job.company_id")
ids = []
for i in request.cr.fetchall():
ids.append(i[0])
companies = request.registry['res.company'].browse(request.cr, request.uid, ids)
values = website.get_rendering_context({
'companies': companies,
'res_job': request.registry['hr.job'].browse(request.cr, request.uid, jobpost_ids)
})
html = website.render("website_hr_recruitment.career", values)

View File

@ -21,29 +21,32 @@
<div class="page-header">
<h1>Job Position</h1>
</div>
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Company Name</th>
<th>Post Name</th>
</tr>
</thead>
<tbody>
<t t-foreach="res_job" t-as="job">
<t t-foreach="companies" t-as="company">
<div class="page-header">
<h1 class="text-center"><t t-esc="company.name"/></h1>
</div>
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<td><span t-if="job.company_id" class="lead"><t t-esc="job.company_id.name"/></span></td>
<td>
<a t-att-href="'/job/detail/%%s' %% job.id"><span class="lead"><t t-esc="job.name"/></span></a><br/>
<span t-if="job.department_id"><t t-esc="job.department_id.name"/></span>
<span><t t-esc="job.post_date"/></span>
</td>
<td>
<a t-att-href="'/job/detail/%%s' %% job.id">Apply</a>
</td>
<th>Post Name</th>
</tr>
</t>
</tbody>
</table>
</thead>
<tbody>
<t t-foreach="res_job" t-as="job">
<tr t-if="job.company_id.id==company.id">
<td>
<a t-att-href="'/job/detail/%%s' %% job.id"><span class="lead"><t t-esc="job.name"/></span></a><br/>
<span t-if="job.department_id"><t t-esc="job.department_id.name"/></span>
<span><t t-esc="job.post_date"/></span>
</td>
<td>
<a t-att-href="'/job/detail/%%s' %% job.id">Apply</a>
</td>
</tr>
</t>
</tbody>
</table>
</t>
</section>
</div>
</t>