enhancements of resume parsing

This commit is contained in:
karuna 2026-07-29 12:51:33 +05:30
parent f698203a7f
commit 957e832abd
3 changed files with 61 additions and 31 deletions

View File

@ -2163,7 +2163,21 @@ class HrRecruitmentAutoDocWizardLine(models.TransientModel):
self.ensure_one() self.ensure_one()
parsed_data = self._get_edited_parsed_data() parsed_data = self._get_edited_parsed_data()
self.extracted_payload = json.dumps(parsed_data, indent=2, ensure_ascii=False) self.extracted_payload = json.dumps(parsed_data, indent=2, ensure_ascii=False)
return {"type": "ir.actions.act_window_close"} return self._action_open_parent_wizard()
def action_close_line(self):
self.ensure_one()
return self._action_open_parent_wizard()
def _action_open_parent_wizard(self):
self.ensure_one()
return {
"type": "ir.actions.act_window",
"res_model": self.wizard_id._name,
"res_id": self.wizard_id.id,
"view_mode": "form",
"target": "new",
}
def _prepare_editable_vals(self, parsed_data): def _prepare_editable_vals(self, parsed_data):
parsed_data = parsed_data or {} parsed_data = parsed_data or {}

View File

@ -127,8 +127,8 @@
</notebook> </notebook>
</sheet> </sheet>
<footer> <footer>
<button name="action_save_line_changes" string="Save &amp; Close" type="object" class="btn-primary"/> <button name="action_save_line_changes" string="Save" type="object" class="btn-primary"/>
<button string="Close" special="cancel" class="btn-secondary"/> <button name="action_close_line" string="Close" type="object" class="btn-secondary"/>
</footer> </footer>
</form> </form>
<kanban class="o_kanban_small_column"> <kanban class="o_kanban_small_column">

View File

@ -284,8 +284,12 @@ class HRApplicant(models.Model):
'applicant_id', 'applicant_id',
string='Request Forms' string='Request Forms'
) )
post_onboarding_form_status = fields.Selection([('draft','Draft'),('email_sent_to_candidate','Email Sent to Candidate'),('done','Done')], default='draft') post_onboarding_form_status = fields.Selection([('draft','Draft'),('email_sent_to_candidate','Email Sent to Candidate'),('done','Done')], default='draft')
legend_blocked = fields.Char(related='recruitment_stage_id.legend_blocked', string='Kanban Blocked') doc_requests_form_status = fields.Selection(
[('draft', 'Draft'), ('email_sent_to_candidate', 'Email Sent to Candidate'), ('done', 'Done')],
default='draft',
)
legend_blocked = fields.Char(related='recruitment_stage_id.legend_blocked', string='Kanban Blocked')
legend_done = fields.Char(related='recruitment_stage_id.legend_done', string='Kanban Valid') legend_done = fields.Char(related='recruitment_stage_id.legend_done', string='Kanban Valid')
legend_normal = fields.Char(related='recruitment_stage_id.legend_normal', string='Kanban Ongoing') legend_normal = fields.Char(related='recruitment_stage_id.legend_normal', string='Kanban Ongoing')
employee_code = fields.Char(related="employee_id.employee_id") employee_code = fields.Char(related="employee_id.employee_id")
@ -300,8 +304,14 @@ class HRApplicant(models.Model):
('validated', 'Validated')], default='pending') ('validated', 'Validated')], default='pending')
approval_required = fields.Boolean(related='recruitment_stage_id.require_approval') approval_required = fields.Boolean(related='recruitment_stage_id.require_approval')
application_submitted = fields.Boolean(string="Application Submitted") application_submitted = fields.Boolean(string="Application Submitted")
resume = fields.Binary(related='candidate_id.resume', readonly=False, compute_sudo=True) send_second_application_form = fields.Boolean(string="Send Second Application Form")
send_post_onboarding_form = fields.Boolean(string="Send Post Onboarding Form")
second_application_form_status = fields.Selection(
[('draft', 'Draft'), ('email_sent_to_candidate', 'Email Sent to Candidate'), ('done', 'Done')],
default='draft',
)
resume = fields.Binary(related='candidate_id.resume', readonly=False, compute_sudo=True)
resume_type = fields.Char(related='candidate_id.resume_type', readonly=False, compute_sudo=True) resume_type = fields.Char(related='candidate_id.resume_type', readonly=False, compute_sudo=True)
resume_name = fields.Char(related='candidate_id.resume_name', readonly=False, compute_sudo=True) resume_name = fields.Char(related='candidate_id.resume_name', readonly=False, compute_sudo=True)
@ -350,11 +360,11 @@ class HRApplicant(models.Model):
'joining_attachment_ids': [(0, 0, values) for values in latest_attachments.values()] 'joining_attachment_ids': [(0, 0, values) for values in latest_attachments.values()]
}) })
def action_share_applicant(self): def action_share_applicant(self):
self.ensure_one() self.ensure_one()
return { return {
'type': 'ir.actions.act_window', 'type': 'ir.actions.act_window',
'name': _('Share Applicant'), 'name': _('Share Applicant'),
'res_model': 'client.submission.mails.template.wizard', 'res_model': 'client.submission.mails.template.wizard',
'view_mode': 'form', 'view_mode': 'form',
'view_id': self.env.ref('hr_recruitment_extended.view_client_submission_mails_template_wizard_form').id, 'view_id': self.env.ref('hr_recruitment_extended.view_client_submission_mails_template_wizard_form').id,
@ -362,12 +372,15 @@ class HRApplicant(models.Model):
'context': { 'context': {
'default_template_id': self.env.ref( 'default_template_id': self.env.ref(
'hr_recruitment_extended.application_client_submission_email_template' 'hr_recruitment_extended.application_client_submission_email_template'
).id, ).id,
}, },
} }
def submit_for_approval(self): def submit_to_client(self):
for rec in self: return self.action_share_applicant()
def submit_for_approval(self):
for rec in self:
manager_id = self.env['ir.config_parameter'].sudo().get_param('requisitions.requisition_manager') manager_id = self.env['ir.config_parameter'].sudo().get_param('requisitions.requisition_manager')
if not manager_id: if not manager_id:
raise ValidationError(_("Recruitment Manager is not selected please go into the Configuration->Settings and add the Manager")) raise ValidationError(_("Recruitment Manager is not selected please go into the Configuration->Settings and add the Manager"))
@ -419,11 +432,11 @@ class HRApplicant(models.Model):
template.send_mail(applicant.id, force_send=True) template.send_mail(applicant.id, force_send=True)
applicant.second_application_form_status = 'email_sent_to_candidate' applicant.second_application_form_status = 'email_sent_to_candidate'
def send_jod_form_to_employee(self): def send_jod_form_to_employee(self):
for rec in self: for rec in self:
if not rec.employee_id: if not rec.employee_id:
raise ValidationError(_('You must first create the employee before before Sending the Post Onboarding Form')) raise ValidationError(_('You must first create the employee before before Sending the Post Onboarding Form'))
elif not rec.employee_id.employee_id: elif not rec.employee_id.employee_id:
raise ValidationError(_('Employee Code for the Employee (%s) is missing')%(rec.employee_id.name)) raise ValidationError(_('Employee Code for the Employee (%s) is missing')%(rec.employee_id.name))
return { return {
@ -432,14 +445,17 @@ class HRApplicant(models.Model):
'res_model': 'post.onboarding.attachment.wizard', 'res_model': 'post.onboarding.attachment.wizard',
'view_mode': 'form', 'view_mode': 'form',
'view_type': 'form', 'view_type': 'form',
'target': 'new', 'target': 'new',
'context': {'default_req_attachment_ids': []} 'context': {'default_req_attachment_ids': []}
} }
def send_post_onboarding_form_to_candidate(self):
def send_pre_onboarding_doc_request_form_to_candidate(self): return self.send_jod_form_to_employee()
return {
'type': 'ir.actions.act_window',
def send_pre_onboarding_doc_request_form_to_candidate(self):
return {
'type': 'ir.actions.act_window',
'name': 'Select Attachments', 'name': 'Select Attachments',
'res_model': 'post.onboarding.attachment.wizard', 'res_model': 'post.onboarding.attachment.wizard',
'view_mode': 'form', 'view_mode': 'form',