[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) <yti@odoo.com>
This commit is contained in:
Rushi Sathawar
2020-09-28 18:18:24 +00:00
committed by Yannick Tivisse
parent 6dd4aca6b4
commit 8990713aa3
2 changed files with 2 additions and 2 deletions
@@ -75,7 +75,7 @@
<header>
<button string="Create Employee" name="create_employee_from_applicant" type="object"
class="oe_highlight o_create_employee" attrs="{'invisible': ['|',('emp_id', '!=', False),('active', '=', False)]}"/>
<button string="Refuse" name="toggle_active" type="object" attrs="{'invisible': [('active', '=', False)]}"/>
<button string="Refuse" name="archive_applicant" type="object" attrs="{'invisible': [('active', '=', False)]}"/>
<button string="Restore" name="toggle_active" type="object" attrs="{'invisible': [('active', '=', True)]}"/>
<field name="stage_id" widget="statusbar" options="{'clickable': '1', 'fold_field': 'fold'}" attrs="{'invisible': [('active', '=', False),('emp_id', '=', False)]}"/>
</header>
@@ -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})