[IMP] improved code to show attachments of applicatns , improved help and lable

bzr revid: tpa@tinyerp.com-20130912054739-nadjpyung33k9ct5
This commit is contained in:
Turkesh Patel (Open ERP) 2013-09-12 11:17:39 +05:30
parent fcf307a224
commit af9b115c98
3 changed files with 8 additions and 4 deletions

View File

@ -344,7 +344,7 @@
</header>
<sheet>
<div class="oe_title">
<label string="Job Name" class="oe_edit_only" colspan="4"/>
<label for="name" class="oe_edit_only" colspan="4"/>
<h1><field name="name" class="oe_inline" nolabel="1" colspan="2"/></h1>
</div>
<div class="oe_right" name="buttons"/>

View File

@ -471,8 +471,11 @@ class hr_job(osv.osv):
def _get_attached_docs(self, cr, uid, ids, field_name, arg, context=None):
"""Calculate total attached CV per job"""
res = {}
attachment_obj = self.pool.get('ir.attachment')
res = {id: attachment_obj.search(cr, uid, [('res_model', '=', 'hr.job'), ('res_id', '=', id)], count=True, context=context) for id in ids}
for job_id in ids:
res_ids = [job_id] + self.pool.get('hr.applicant').search(cr, uid, [('job_id', '=', job_id)], context=context)
res[job_id] = attachment_obj.search(cr, uid, [('res_model', 'in', ['hr.job', 'hr.applicant']), ('res_id', 'in', res_ids)], count=True, context=context)
return res
_columns = {
@ -523,7 +526,8 @@ class hr_job(osv.osv):
}
def attachment_tree_view(self, cr, uid, ids, context):
domain = ['&', ('res_model', '=', 'hr.job'), ('res_id', 'in', ids)]
res_ids = ids + self.pool.get('hr.applicant').search(cr, uid, [('job_id', 'in', ids)], context=context)
domain = ['&', ('res_model', 'in', ['hr.job', 'hr.applicant']), ('res_id', 'in', res_ids)]
res_id = ids and ids[0] or False
return {
'name': _('Attachments'),

View File

@ -458,7 +458,7 @@
<field name="context">{'search_default_in_recruitment': 1}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click here to create a new job or remove the filter on "On Recruitment" to recruit for an on hold job.
Click here to create a new job or remove the filter on "In Recruitment" to recruit for an on hold job.
</p>
<p>
Define job position profile and manage recruitment in a context of a particular job: print interview survey, define number of expected new employees, and manage its recruitment pipe