From c44818342629ab652ddba609fcbdff0db510ab4b Mon Sep 17 00:00:00 2001 From: Rob Coekaerts Date: Thu, 8 Sep 2022 12:23:23 +0000 Subject: [PATCH] [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 --- .../hr_recruitment/models/hr_recruitment.py | 19 +++++++++++++++++-- .../views/hr_recruitment_views.xml | 4 +++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/addons/hr_recruitment/models/hr_recruitment.py b/addons/hr_recruitment/models/hr_recruitment.py index 966547003ef..670711178c4 100644 --- a/addons/hr_recruitment/models/hr_recruitment.py +++ b/addons/hr_recruitment/models/hr_recruitment.py @@ -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):

%(para_1)s
%(para_2)s

""" 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 = "%s" % (email, email) nocontent_values['email_link'] = email_link nocontent_body += """

%(email_link)s

""" @@ -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 diff --git a/addons/hr_recruitment/views/hr_recruitment_views.xml b/addons/hr_recruitment/views/hr_recruitment_views.xml index 8acf8dfdb76..1ade582c330 100644 --- a/addons/hr_recruitment/views/hr_recruitment_views.xml +++ b/addons/hr_recruitment/views/hr_recruitment_views.xml @@ -33,14 +33,16 @@ + + + -