diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 467f34f708b..2f2494aea81 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -118,6 +118,7 @@ class hr_job(osv.osv): 'company_id': fields.many2one('res.company', 'Company'), 'state': fields.selection([('open', 'No Recruitment'), ('recruit', 'Recruitement in Progress')], 'Status', readonly=True, required=True, help="By default 'In position', set it to 'In Recruitment' if recruitment process is going on for this job position."), + 'color': fields.integer('Color Index'), } _defaults = { 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr.job', context=c), diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 670b31c289b..d09b6430e01 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -494,6 +494,8 @@ class hr_job(osv.osv): _inherits = {'mail.alias': 'alias_id'} def _count_priority(self, cr, uid, ids, name, args, context=None): + """Applicant, priority count like number of star 3,2,1(star rating) + """ res = {} for position in self.browse(cr, uid,ids, context=context): res[position.id] = {} @@ -501,8 +503,8 @@ class hr_job(osv.osv): priority2 = 0 priority3 = 0 applicant_obj = self.pool.get('hr.applicant') - a_ids = applicant_obj.search(cr, uid, [('job_id', '=', position.id)], context=context) - for applicant in self.pool.get('hr.applicant').browse(cr, uid, a_ids, context=context): + rate_ids = applicant_obj.search(cr, uid, [('job_id', '=', position.id)], context=context) + for applicant in self.pool.get('hr.applicant').browse(cr, uid, rate_ids, context=context): if applicant.job_id.id == position.id: if applicant.priority == '3': priority1 += 1 @@ -516,14 +518,18 @@ class hr_job(osv.osv): return res def _get_department_mgr(self, cr, uid, ids, name, args, context=None): + """get manager image for specific job position. + """ res = {} + employee_obj = self.pool.get('hr.employee') for obj_job in self.browse(cr, uid,ids, context=context): res[obj_job.id] = {} if obj_job.department_id: - emp_ids = self.pool.get('hr.employee').search(cr, uid, [('id', '=', obj_job.department_id.manager_id.id)], context=context) + emp_ids = employee_obj.search(cr, uid, [('id', '=', obj_job.department_id.manager_id.id)], context=context) if emp_ids: - res[obj_job.id] = emp_ids + for employee in employee_obj.browse(cr, uid, emp_ids, context=context): + res[obj_job.id] = {'id':employee.id, 'name': employee.name} return res _columns = { diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml index ff6e8f50abb..f8dabe70915 100644 --- a/addons/hr_recruitment/hr_recruitment_view.xml +++ b/addons/hr_recruitment/hr_recruitment_view.xml @@ -347,7 +347,7 @@

-

+

Employees