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>
15 lines
488 B
Python
15 lines
488 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from odoo import api, fields, models
|
|
|
|
|
|
class ApplicantGetRefuseReason(models.TransientModel):
|
|
_name = 'applicant.get.refuse.reason'
|
|
_description = 'Get Refuse Reason'
|
|
|
|
refuse_reason_id = fields.Many2one('hr.applicant.refuse.reason', 'Refuse Reason')
|
|
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, 'active': False})
|