[FIX] code cleanup (addon hr_recruitment)
remove try/except/pass in method _count_all, improves the logic bzr revid: ged@openerp.com-20140507131629-knp2kvw2zs1k200x
This commit is contained in:
parent
5e5333a1e9
commit
626915508d
|
@ -530,15 +530,14 @@ class hr_job(osv.osv):
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def _count_all(self, cr, uid, ids, field_name, arg, context=None):
|
def _count_all(self, cr, uid, ids, field_name, arg, context=None):
|
||||||
res = dict(map(lambda x: (x,{'documents_count': 0, 'application_count': 0,}), ids))
|
Applicant = self.pool['hr.applicant']
|
||||||
try:
|
return {
|
||||||
for job in self.browse(cr, uid, ids, context=context):
|
job_id: {
|
||||||
res[job.id] = {'documents_count': len(job.document_ids),
|
'application_count': Applicant.search_count(cr,uid, [('job_id', '=', job_id)], context=context),
|
||||||
'application_count': len(job.applicant_ids),
|
'documents_count': len(self._get_attached_docs(cr, uid, [job_id], field_name, arg, context=context)[job_id])
|
||||||
}
|
}
|
||||||
except:
|
for job_id in ids
|
||||||
pass
|
}
|
||||||
return res
|
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'survey_id': fields.many2one('survey.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"),
|
'survey_id': fields.many2one('survey.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"),
|
||||||
|
|
Loading…
Reference in New Issue