diff options
| author | Rushi Sathawar <rus@odoo.com> | 2020-09-03 13:20:33 +0000 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2020-09-28 14:42:14 +0000 |
| commit | 9dfb85b494efeec7786d345315977b9bcea63b82 (patch) | |
| tree | 6c1f9d2cb173bf2366711ef14537a1c26832122b /addons/hr_recruitment | |
| parent | 27a85263526ebf7621d5767939b984988f9352ba (diff) | |
[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#58629
Taskid: 2333037
X-original-commit: 7e7f0b8787eb08cac95da1aa3a8c9e71024f3c75
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/hr_recruitment')
| -rw-r--r-- | addons/hr_recruitment/views/hr_recruitment_views.xml | 2 | ||||
| -rw-r--r-- | 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 @@ <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> 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}) |
