Recruitment Changes

This commit is contained in:
Pranay 2025-03-20 19:03:52 +05:30
parent a9650eb637
commit a64fdf9a43
12 changed files with 69 additions and 108 deletions

View File

@ -106,6 +106,7 @@ class HRJobRecruitment(models.Model):
rec.description = rec.job_id.description
job_id = fields.Many2one('hr.job', required=True)
name = fields.Char(string='Job Position', required=True, index='trigram', translate=True, related='job_id.name')
recruitment_sequence = fields.Char(string='Recruitment Sequence', readonly=False, default='/', copy=False)
@ -114,7 +115,7 @@ class HRJobRecruitment(models.Model):
secondary_skill_ids = fields.Many2many('hr.skill', "hr_job_recruitment_hr_skill_rel",
'job_recruitment_id', 'hr_skill_id', "Secondary Skills")
no_of_recruitment = fields.Integer(string='Number Of Positions', copy=False,
no_of_recruitment = fields.Integer(string='Target', copy=False,
help='Number of new employees you expect to recruit.', default=1)

View File

@ -15,9 +15,9 @@ class HrCandidate(models.Model):
_inherit = "hr.candidate"
#personal Details
first_name = fields.Char(string='First Name',required=True, help="This is the person's first name, given at birth or during a naming ceremony. Its the name people use to address you.")
first_name = fields.Char(string='First Name',required=False, help="This is the person's first name, given at birth or during a naming ceremony. Its the name people use to address you.")
middle_name = fields.Char(string='Middle Name', help="This is an extra name that comes between the first name and last name. Not everyone has a middle name")
last_name = fields.Char(string='Last Name',required=True, help="This is the family name, shared with other family members. Its usually the last name.")
last_name = fields.Char(string='Last Name',required=False, help="This is the family name, shared with other family members. Its usually the last name.")
alternate_phone = fields.Char(string='Alternate Phone')
candidate_image = fields.Image()
employee_code = fields.Char(related="employee_id.employee_id")

View File

@ -10,6 +10,7 @@
<field name="name">User: All Applicants</field>
<field name="model_id" ref="model_hr_job_recruitment"/>
<field name="domain_force">[('interviewer_ids', 'in', user.id)]</field>
<field name="active">false</field>
<field name="groups" eval="[(4, ref('hr_recruitment.group_hr_recruitment_interviewer'))]"/>
</record>

View File

@ -7,9 +7,9 @@
<field name="model">candidate.experience</field>
<field name="arch" type="xml">
<list editable="bottom">
<field name="experience_code" placeholder = "E1" required="1"/>
<field name="experience_from" required="1" placeholder="0"/>
<field name="experience_to" required="1" placeholder="2"/>
<field name="experience_code" placeholder = "E1" required="1" col="3"/>
<field name="experience_from" required="1" placeholder="0" col="3"/>
<field name="experience_to" required="1" placeholder="2" col="3"/>
<!-- <field name="active"/>-->
</list>
</field>

View File

@ -314,23 +314,11 @@
<!-- Full Name Fields -->
<div class="row mb-3">
<div class="col-md-4">
<label class="form-label">First Name</label>
<input type="text" class="form-control" name="first_name"
t-att-value="applicant.candidate_id.first_name" readonly="1"
<label class="form-label">Name (As Per Aadhar)</label>
<input type="text" class="form-control" name="full_name"
t-att-value="applicant.candidate_id.partner_name" readonly="1"
/>
</div>
<div class="col-md-4">
<label class="form-label">Middle Name</label>
<input type="text" class="form-control" name="middle_name"
t-att-value="applicant.candidate_id.middle_name" readonly="1"
/>
</div>
<div class="col-md-4">
<label class="form-label">Last Name</label>
<input type="text" class="form-control" name="last_name"
t-att-value="applicant.candidate_id.last_name" readonly="1"
placeholder="SURNAME"/>
</div>
</div>

View File

@ -65,10 +65,10 @@ class WebsiteJobHrRecruitment(WebsiteHrRecruitment):
'is_other_department': is_other_department,
'is_untyped': is_untyped,
}
total, details, fuzzy_search_term = request.website._search_with_fuzzy("jobs", search,
total, details, fuzzy_search_term = request.website._search_with_fuzzy("job_requests", search,
limit=1000, order="is_published desc, sequence, no_of_recruitment desc", options=options)
# Browse jobs as superuser, because address is restricted
jobs = details[1].get('results', Jobs).sudo()
jobs = details[0].get('results', Jobs).sudo()
def sort(records_list, field_name):
""" Sort records in the given collection according to the given
@ -425,11 +425,7 @@ class WebsiteJobHrRecruitment(WebsiteHrRecruitment):
if model.model == 'hr.applicant':
# pop the fields since there are only useful to generate a candidate record
# partner_name = values.pop('partner_name')
first_name = values.pop('first_name', None)
middle_name = values.pop('middle_name', None)
last_name = values.pop('last_name', None)
partner_name = values.pop('full_name', None)
partner_phone = values.pop('partner_phone', None)
alternate_phone = values.pop('alternate_phone', None)
partner_email = values.pop('email_from', None)
@ -441,10 +437,7 @@ class WebsiteJobHrRecruitment(WebsiteHrRecruitment):
], limit=1)
if candidate:
candidate.sudo().write({
'partner_name': f"{first_name + ' ' + ((middle_name + ' ') if middle_name else '') + last_name}",
'first_name': first_name,
'middle_name': middle_name,
'last_name': last_name,
'partner_name': partner_name,
'alternate_phone': alternate_phone,
'email_from': partner_email,
'partner_phone': partner_phone,
@ -453,12 +446,9 @@ class WebsiteJobHrRecruitment(WebsiteHrRecruitment):
})
if not candidate:
candidate = request.env['hr.candidate'].sudo().create({
'partner_name': f"{first_name + ' ' + ((middle_name + ' ') if middle_name else '') + last_name}",
'partner_name': partner_name,
'email_from': partner_email,
'partner_phone': partner_phone,
'first_name': first_name,
'middle_name': middle_name,
'last_name': last_name,
'alternate_phone': alternate_phone,
'type_id': int(degree) if degree.isdigit() else False,
'resume': extracted_resume
@ -482,7 +472,7 @@ class WebsiteJobHrRecruitment(WebsiteHrRecruitment):
else:
skills = None
values['partner_name'] = f"{first_name + ' ' + ((middle_name + ' ') if middle_name else '') + last_name}"
values['partner_name'] = partner_name
if partner_phone:
values['partner_phone'] = partner_phone
if partner_email:

View File

@ -118,16 +118,16 @@ class JobRecruitment(models.Model):
domain.append([('website_published', '=', True)])
search_fields = ['name']
fetch_fields = ['name', 'website_url']
search_fields = ['recruitment_sequence']
fetch_fields = ['recruitment_sequence', 'website_url']
mapping = {
'name': {'name': 'name', 'type': 'text', 'match': True},
'recruitment_sequence': {'name': 'recruitment_sequence', 'type': 'text', 'match': True},
'website_url': {'name': 'website_url', 'type': 'text', 'truncate': False},
}
if with_description:
search_fields.append('description')
fetch_fields.append('description')
mapping['description'] = {'name': 'description', 'type': 'text', 'html': True, 'match': True}
# if with_description:
# search_fields.append('description')
# fetch_fields.append('description')
# mapping['description'] = {'name': 'description', 'type': 'text', 'html': True, 'match': True}
return {
'model': 'hr.job.recruitment',
'requires_sudo': requires_sudo,

View File

@ -14,6 +14,8 @@ class Website(models.Model):
def _search_get_details(self, search_type, order, options):
result = super()._search_get_details(search_type, order, options)
if search_type in ['jobs', 'all']:
if search_type in ['job_requests', 'all']:
result.append(self.env['hr.job.recruitment']._search_get_detail(self, order, options))
print(result)
print("hello result")
return result

View File

@ -1,4 +1,4 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_hr_job_public_recruitment_public,hr.job.recruitment.public,hr_recruitment_extended.model_hr_job_recruitment,base.group_public,1,0,0,0
access_hr_job_public_recruitment_portal,hr.job.recruitment.public,hr_recruitment_extended.model_hr_job_recruitment,base.group_portal,1,0,0,0
access_hr_job_public_recruitment_employee,hr.job.recruitment.public,hr_recruitment_extended.model_hr_job_recruitment,base.group_user,1,0,0,0
access_hr_job_public_recruitment_portal,hr.job.recruitment.portal,hr_recruitment_extended.model_hr_job_recruitment,base.group_portal,1,0,0,0
access_hr_job_public_recruitment_employee,hr.job.recruitment.employee,hr_recruitment_extended.model_hr_job_recruitment,base.group_user,1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_job_public_recruitment_public hr.job.recruitment.public hr_recruitment_extended.model_hr_job_recruitment base.group_public 1 0 0 0
3 access_hr_job_public_recruitment_portal hr.job.recruitment.public hr.job.recruitment.portal hr_recruitment_extended.model_hr_job_recruitment base.group_portal 1 0 0 0
4 access_hr_job_public_recruitment_employee hr.job.recruitment.public hr.job.recruitment.employee hr_recruitment_extended.model_hr_job_recruitment base.group_user 1 0 0 0

View File

@ -31,6 +31,15 @@
<field name="perm_create" eval="False"/>
<field name="perm_unlink" eval="False"/>
</record>
<!-- <function name="write" model="ir.model.data">-->
<!-- <function name="search" model="ir.model.data">-->
<!-- <value eval="[('module', '=', 'website_hr_recruitment'), ('name','=','hr_job_portal')] "/>-->
<!-- </function>-->
<!-- <value eval=" {'noupdate': True} "/>-->
<!-- </function>-->
<!-- <record id="hr_department_public" model="ir.rule">-->
<!-- <field name="name">Job department: Public</field>-->
<!-- <field name="model_id" ref="hr.model_hr_department"/>-->

View File

@ -13,7 +13,7 @@ publicWidget.registry.CustomHrRecruitment = publicWidget.registry.hrRecruitment.
'click #apply-btn': '_onClickApplyButton',
"focusout #recruitmentlname" : "_onFocusOutLastName",
"focusout #recruitmentmname" : "_onFocusOutMiddleName",
"focusout #recruitmentfname" : "_onFocusOutFirstName",
"focusout #recruitmentname" : "_onFocusOutFullName",
'focusout #recruitmentemail' : '_onFocusOutRecruitmentMail',
'focusout #recruitmentlinkdin' : '_onFocusOutRecruitmentLinkedin',
'focusout #recruitmentctc' : '_onFocusOutCTC',
@ -125,9 +125,9 @@ publicWidget.registry.CustomHrRecruitment = publicWidget.registry.hrRecruitment.
async _onFocusOutFirstName(ev) {
async _onFocusOutFullName(ev) {
const field = "first_name"
const field = "full_name"
const messageContainerId = "#warning-message";
await this.checkRedundant(ev.currentTarget, field, messageContainerId);
},

View File

@ -248,66 +248,36 @@
<div class="form-step active">
<div class="scrollable-content">
<div class="s_website_form_rows row s_col_no_bgcolor">
<div class="col-12 col-sm-4 mb-0 py-2 s_website_form_field s_website_form_required s_website_form_model_required"
data-type="char" data-name="Field">
<div class="row s_col_no_resize s_col_no_bgcolor">
<label class="col-12 s_website_form_label"
for="recruitmentname">
<span class="s_website_form_label_content">First Name
</span>
<span class="s_website_form_mark">*</span>
</label>
<div class="col-12">
<input id="recruitmentfname" type="text"
class="form-control s_website_form_input"
name="first_name" required="1"
data-fill-with="first_name"
placeholder="e.g. Pranay"/>
</div>
</div>
</div>
<div class="col-12 col-sm-4 mb-0 py-2 s_website_form_field"
data-type="char" data-name="Field">
<div class="row s_col_no_resize s_col_no_bgcolor">
<label class="col-12 s_website_form_label"
for="recruitmentname">
<span class="s_website_form_label_content">Middle Name
</span>
</label>
<div class="col-12">
<input id="recruitmentmname" type="text"
class="form-control s_website_form_input"
name="middle_name"
data-fill-with="middle_name"
placeholder="e.g. Kumar"/>
</div>
</div>
</div>
<div class="col-12 col-sm-4 mb-0 py-2 s_website_form_field s_website_form_required s_website_form_model_required"
data-type="char" data-name="Field">
<div class="row s_col_no_resize s_col_no_bgcolor">
<label class="col-12 s_website_form_label"
for="recruitmentname">
<span class="s_website_form_label_content">Last Name
</span>
<span class="s_website_form_mark">*</span>
</label>
<div class="col-12">
<input id="recruitmentlname" type="text"
class="form-control s_website_form_input"
name="last_name" required="1"
data-fill-with="last_name"
placeholder="e.g. Gadi (SURNAME)"/>
</div>
</div>
</div>
</div>
<div>
<div class="row s_col_no_resize s_col_no_bgcolor">
<!-- Name Field-->
<div class="col-12 mb-0 py-2 s_website_form_field s_website_form_required"
data-type="char" data-name="Field">
<div class="row s_col_no_resize s_col_no_bgcolor">
<label class="col-4 col-sm-auto s_website_form_label"
style="width: 200px"
for="recruitmentname">
<span class="s_website_form_label_content">Name
</span>
<span class="s_website_form_mark">*</span>
</label>
<div class="col-sm">
<input id="recruitmentname" type="text"
class="form-control s_website_form_input"
name="full_name" required="1"
data-fill-with="full_name"
placeholder="Enter Name"/>
<div class="alert alert-warning mt-2 d-flex align-items-center"
style="background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; padding: 10px; border-radius: 5px;">
<i class="fa fa-exclamation-circle"
style="font-size: 20px; margin-right: 10px;"></i>
<strong>Note:</strong>
Please provide name as per Aadhar.
</div>
</div>
</div>
</div>
<!-- Email Field -->
<div class="col-12 mb-0 py-2 s_website_form_field s_website_form_required"