[IMP]Search within the content of the resume in the search view of an applicant,

bzr revid: dhr@tinyerp.com-20130314113116-lh4v21bm0mt4d9lc
This commit is contained in:
Dharti Ratani (Open ERP)
2013-03-14 17:01:16 +05:30
parent b0623b619d
commit 09df39578d
2 changed files with 15 additions and 0 deletions
+13
View File
@@ -195,6 +195,17 @@ class hr_applicant(base_stage, osv.Model):
res[issue.id] = len(attach)
return res
def _get_index_content(self, cr, uid, ids, fields, args, context=None):
res = {}
attachment_pool = self.pool.get('ir.attachment')
for issue in self.browse(cr, uid, ids, context=context):
res[issue.id] = 0
attach_id = attachment_pool.search(cr, uid, [('res_model','=','hr.applicant'),('res_id','=',issue.id)])
if attach_id:
for attach in attachment_pool.browse(cr, uid, attach_id, context):
res[issue.id] = attach.index_content
return res
_columns = {
'name': fields.char('Subject', size=128, required=True),
'active': fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the case without removing it."),
@@ -247,6 +258,8 @@ class hr_applicant(base_stage, osv.Model):
'emp_id': fields.many2one('hr.employee', 'employee'),
'attachments': fields.function(_compute_attachments, string='Attachments', \
type="integer"),
'index_content': fields.function(_get_index_content, string='Index Content', \
type="char",store=True),
'user_email': fields.related('user_id', 'email', type='char', string='User Email', readonly=True),
}
@@ -58,6 +58,7 @@
<field name="availability" invisible="1"/>
<field name="department_id" invisible="context.get('invisible_department', True)"/>
<field name="user_id"/>
<field name="index_content" invisible="1"/>
<field name="state" invisible="1"/>
</tree>
</field>
@@ -185,6 +186,7 @@
<separator/>
<filter string="Next Actions" context="{'invisible_next_action':False, 'invisible_next_date':False}"
domain="[('date_action','&lt;&gt;',False)]" help="Filter and view on next actions and date"/>
<field name="index_content" string="Resume Content"/>
<field name="job_id"/>
<field name="user_id"/>
<separator/>