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/hr_demo.xml b/addons/hr/hr_demo.xml
index 3f34a703475..42d24fc7d29 100644
--- a/addons/hr/hr_demo.xml
+++ b/addons/hr/hr_demo.xml
@@ -31,11 +31,13 @@
Chief Executive Officer
+ 3
Chief Technical Officer
+ 5
@@ -46,6 +48,7 @@
Developer
+ 2
diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py
index deccf10619f..3698eb20838 100644
--- a/addons/hr_recruitment/hr_recruitment.py
+++ b/addons/hr_recruitment/hr_recruitment.py
@@ -492,11 +492,53 @@ class hr_job(osv.osv):
_inherit = "hr.job"
_name = "hr.job"
_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] = {}
+ priority1 = 0
+ priority2 = 0
+ priority3 = 0
+ applicant_obj = self.pool.get('hr.applicant')
+ 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
+ elif applicant.priority == '2':
+ priority2 += 1
+ elif applicant.priority == '1':
+ priority3 += 1
+ else:
+ pass
+ res[position.id] = {'priority1': priority1, 'priority2': priority2, 'priority3': priority3}
+ 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 = employee_obj.search(cr, uid, [('id', '=', obj_job.department_id.manager_id.id)], context=context)
+ if 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 = {
'survey_id': fields.many2one('survey', 'Interview Form', help="Choose an interview form for this job position and you will be able to print/answer this interview from all applicants who apply for this job"),
'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="cascade", required=True,
help="Email alias for this job position. New emails will automatically "
"create new applicants for this job position."),
+ 'priority_count': fields.function(_count_priority, string='Total Priority Employees', type="char"),
+ 'user_id': fields.function(_get_department_mgr, string='Department Manager', type="char"),#manager image in kanban
}
_defaults = {
'alias_domain': False, # always hide alias during creation
diff --git a/addons/hr_recruitment/hr_recruitment_menu.xml b/addons/hr_recruitment/hr_recruitment_menu.xml
index 009029d7524..2bd7b00448b 100644
--- a/addons/hr_recruitment/hr_recruitment_menu.xml
+++ b/addons/hr_recruitment/hr_recruitment_menu.xml
@@ -59,7 +59,7 @@
sequence="1"/>
-
+
+
+
+
-
+
@@ -369,7 +390,7 @@
-
+
Job Positions
hr.job
form