[FIX] HR Recruitment, numbers

bzr revid: fp@openerp.com-20131116095814-xk9wu0mqhxrh847c
This commit is contained in:
Fabien Pinckaers 2013-11-16 10:58:14 +01:00
parent c69f31d82c
commit 1129cc5d39
2 changed files with 4 additions and 3 deletions

View File

@ -110,7 +110,7 @@ class hr_job(osv.osv):
'hr.employee': (_get_job_position, ['job_id'], 10),
}, type='integer',
multi='no_of_employee'),
'no_of_recruitment': fields.float('Expected in Recruitment', help='Number of new employees you expect to recruit.'),
'no_of_recruitment': fields.integer('Expected in Recruitment', help='Number of new employees you expect to recruit.'),
'employee_ids': fields.one2many('hr.employee', 'job_id', 'Employees', groups='base.group_user'),
'description': fields.text('Job Description'),
'requirements': fields.text('Requirements'),
@ -122,6 +122,7 @@ class hr_job(osv.osv):
}
_defaults = {
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr.job', context=c),
'no_of_recruitment': 0,
'state': 'open',
}

View File

@ -14,7 +14,7 @@ class website_hr_recruitment(http.Controller):
def jobs(self, department=None, office=None, page=0):
hr_job_obj = request.registry['hr.job']
domain = []
jobpost_ids = hr_job_obj.search(request.cr, request.uid, domain, order="website_published desc,no_of_recruitment", context=request.context)
jobpost_ids = hr_job_obj.search(request.cr, request.uid, domain, order="website_published desc,no_of_recruitment desc", context=request.context)
jobs = hr_job_obj.browse(request.cr, request.uid, jobpost_ids, request.context)
departments = set()
@ -32,7 +32,7 @@ class website_hr_recruitment(http.Controller):
domain += [('address_id','=', office.id)]
if department:
domain += [('department_id','=', department.id)]
jobpost_ids = hr_job_obj.search(request.cr, request.uid, domain, order="website_published,no_of_recruitment", context=request.context)
jobpost_ids = hr_job_obj.search(request.cr, request.uid, domain, order="website_published,no_of_recruitment desc", context=request.context)
jobs = hr_job_obj.browse(request.cr, request.uid, jobpost_ids, request.context)
return request.website.render("website_hr_recruitment.index", {