From 8990713aa3d38652d19de39e6ea5016a7c9cb2a9 Mon Sep 17 00:00:00 2001 From: Rushi Sathawar Date: Thu, 3 Sep 2020 13:20:33 +0000 Subject: [PATCH] [FIX] hr_recruitment: Prevent toggle active on refuse applicant Currently, when click on refuse action on applicant it will call the toogle_active and applicant is archived then it will going to open the wizard for refuse reason due to that even if user cancel the wizard the applicant is archived. So in this commit, On click of the 'refuse' on applicant just open the wizard for refuse reason and click of apply archive the applicant with reason. It will not affect the opening of wizard on archive of applicant from action menu. closes odoo/odoo#58740 Taskid: 2333037 X-original-commit: 9dfb85b494efeec7786d345315977b9bcea63b82 Signed-off-by: Yannick Tivisse (yti) --- addons/hr_recruitment/views/hr_recruitment_views.xml | 2 +- addons/hr_recruitment/wizard/applicant_refuse_reason.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_recruitment/views/hr_recruitment_views.xml b/addons/hr_recruitment/views/hr_recruitment_views.xml index 379141c28cc..6f9119148b5 100644 --- a/addons/hr_recruitment/views/hr_recruitment_views.xml +++ b/addons/hr_recruitment/views/hr_recruitment_views.xml @@ -75,7 +75,7 @@
diff --git a/addons/hr_recruitment/wizard/applicant_refuse_reason.py b/addons/hr_recruitment/wizard/applicant_refuse_reason.py index ffb0259a571..41bd5119e4f 100644 --- a/addons/hr_recruitment/wizard/applicant_refuse_reason.py +++ b/addons/hr_recruitment/wizard/applicant_refuse_reason.py @@ -11,4 +11,4 @@ class ApplicantGetRefuseReason(models.TransientModel): applicant_ids = fields.Many2many('hr.applicant') def action_refuse_reason_apply(self): - return self.applicant_ids.write({'refuse_reason_id': self.refuse_reason_id.id}) + return self.applicant_ids.write({'refuse_reason_id': self.refuse_reason_id.id, 'active': False})