[IMP] hr_recruitment: improve UX of applicants list view
Currently clicking the 'Other applications' smartbutton on an application redirects to a kanban view that does not have very useful information. With this commit, this smartbutton now redirects to the application list view and adds small UX changes to this list view. task-2946398 closes odoo/odoo#99828 Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
@@ -194,6 +194,11 @@ class Applicant(models.Model):
|
||||
'res.users', string='Interviewer', index=True, tracking=True,
|
||||
domain="[('share', '=', False), ('company_ids', 'in', company_id)]")
|
||||
linkedin_profile = fields.Char('LinkedIn Profile')
|
||||
application_status = fields.Selection([
|
||||
('ongoing', 'Ongoing'),
|
||||
('hired', 'Hired'),
|
||||
('refused', 'Refused'),
|
||||
], compute="_compute_application_status")
|
||||
|
||||
@api.onchange('job_id')
|
||||
def _onchange_job_id(self):
|
||||
@@ -281,6 +286,16 @@ class Applicant(models.Model):
|
||||
else:
|
||||
applicant.meeting_display_text = _('Last Meeting')
|
||||
|
||||
@api.depends('refuse_reason_id', 'date_closed')
|
||||
def _compute_application_status(self):
|
||||
for applicant in self:
|
||||
if applicant.refuse_reason_id:
|
||||
applicant.application_status = 'refused'
|
||||
elif applicant.date_closed:
|
||||
applicant.application_status = 'hired'
|
||||
else:
|
||||
applicant.application_status = 'ongoing'
|
||||
|
||||
def _get_attachment_number(self):
|
||||
read_group_res = self.env['ir.attachment']._read_group(
|
||||
[('res_model', '=', 'hr.applicant'), ('res_id', 'in', self.ids)],
|
||||
@@ -433,7 +448,7 @@ class Applicant(models.Model):
|
||||
<p>%(para_1)s<br/>%(para_2)s</p>"""
|
||||
|
||||
if alias_id and alias_id.alias_domain and alias_id.alias_name:
|
||||
email = alias_id.display_name
|
||||
email = alias_id.display_name
|
||||
email_link = "<a href='mailto:%s'>%s</a>" % (email, email)
|
||||
nocontent_values['email_link'] = email_link
|
||||
nocontent_body += """<p class="o_copy_paste_email">%(email_link)s</p>"""
|
||||
@@ -508,7 +523,7 @@ class Applicant(models.Model):
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': _('Job Applications'),
|
||||
'res_model': self._name,
|
||||
'view_mode': 'kanban,tree,form,pivot,graph,calendar,activity',
|
||||
'view_mode': 'tree,kanban,form,pivot,graph,calendar,activity',
|
||||
'domain': [('id', 'in', ids)],
|
||||
'context': {
|
||||
'active_test': False
|
||||
|
||||
@@ -33,14 +33,16 @@
|
||||
<field name="job_id"/>
|
||||
<field name="name" readonly="1"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="application_status" optional="show" attrs="{'invisible': [('application_status', '=', 'ongoing')]}"/>
|
||||
<field name="refuse_reason_id" optional='hide'/>
|
||||
<field name="priority" widget="priority" optional="show"/>
|
||||
<field name="email_from" readonly="1" optional="hide"/>
|
||||
<field name="partner_mobile" widget="phone" readonly="1" optional="show" class="text-end"/>
|
||||
<field name="categ_ids" widget="many2many_tags" options="{'color_field': 'color'}" optional="show"/>
|
||||
<field name="user_id" widget="many2one_avatar_user" optional="show"/>
|
||||
<field name="interviewer_id" widget="many2one_avatar_user" optional="hide"/>
|
||||
<field name="create_date" readonly="1" widget="date" optional="show"/>
|
||||
<field name="partner_phone" widget="phone" readonly="1" optional="hide"/>
|
||||
<field name="email_from" readonly="1" optional="hide"/>
|
||||
<field name="medium_id" optional="hide"/>
|
||||
<field name="source_id" readonly="1" optional="hide"/>
|
||||
<field name="salary_expected" optional="hide"/>
|
||||
|
||||
Reference in New Issue
Block a user