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
%(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 @@