Recruitment Changes

This commit is contained in:
Pranay 2025-03-24 13:10:34 +05:30 committed by raman
parent c8902cd7f2
commit e24e329b27
4 changed files with 19 additions and 14 deletions

View File

@ -13,14 +13,15 @@ class CandidateExperience(models.Model):
experience_code = fields.Char('Experience Code') experience_code = fields.Char('Experience Code')
experience_from = fields.Integer(string="Experience From (Years)") experience_from = fields.Integer(string="Experience From (Years)")
experience_to = fields.Integer(string="Experience To (Years)") experience_to = fields.Integer(string="Experience To (Years)")
# display_name = fields.Char(string="Display Name")
# active = fields.Boolean() # active = fields.Boolean()
def name_get(self): # def name_get(self):
""" Override name_get to display a custom name based on recruitment_sequence and job_id """ # for record in self:
result = [] # name = f"{record.experience_code} ({record.experience_from} - {record.experience_to})"
for record in self: # return name
# Combine recruitment_sequence and job_id name for the display name
name = f"{record.experience_code} - {record.experience_from} - {record.experience_To} years" @api.depends('experience_code', 'experience_from', 'experience_to')
result.append((record.id, name)) def _compute_display_name(self):
return result for template in self:
template.display_name = False if not template.experience_code else f"{template.experience_code} ({template.experience_from} - {template.experience_to} Years)"

View File

@ -202,6 +202,8 @@ class HRJobRecruitment(models.Model):
help='Number of Refused Application submissions for this job position during recruitment phase.', help='Number of Refused Application submissions for this job position during recruitment phase.',
) )
experience = fields.Many2one('candidate.experience', string="Experience")
@api.depends('application_ids.submitted_to_client') @api.depends('application_ids.submitted_to_client')
def _compute_no_of_submissions(self): def _compute_no_of_submissions(self):
counts = dict(self.env['hr.applicant']._read_group( counts = dict(self.env['hr.applicant']._read_group(

View File

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

View File

@ -18,6 +18,7 @@
<field name="no_of_hired_employee" optional="hide"/> <field name="no_of_hired_employee" optional="hide"/>
<field name="message_needaction" column_invisible="True"/> <field name="message_needaction" column_invisible="True"/>
<field name="company_id" groups="base.group_multi_company" optional="hide"/> <field name="company_id" groups="base.group_multi_company" optional="hide"/>
<field name="experience" optional="hide"/>
<field name="company_id" column_invisible="True"/> <field name="company_id" column_invisible="True"/>
<field name="alias_name" column_invisible="True"/> <field name="alias_name" column_invisible="True"/>
<field name="alias_id" invisible="not alias_name" optional="hide"/> <field name="alias_id" invisible="not alias_name" optional="hide"/>
@ -164,6 +165,7 @@
<span>new Employees to hire</span> <span>new Employees to hire</span>
</div> </div>
<field name="no_of_eligible_submissions"/> <field name="no_of_eligible_submissions"/>
<field name="experience"/>
<field name="website_id" options="{'no_create': True}" <field name="website_id" options="{'no_create': True}"
domain="['|', ('company_id', '=', company_id), ('company_id', '=', False)]" domain="['|', ('company_id', '=', company_id), ('company_id', '=', False)]"
on_change="1" can_create="True" can_write="True"/> on_change="1" can_create="True" can_write="True"/>
@ -228,7 +230,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<kanban highlight_color="color" class="o_hr_recruitment_kanban" sample="1" limit="40" action="%(action_hr_job_recruitment_applications)d" type="action" js_class="recruitment_kanban_view"> <kanban highlight_color="color" class="o_hr_recruitment_kanban" sample="1" limit="40" action="%(action_hr_job_recruitment_applications)d" type="action" js_class="recruitment_kanban_view">
<field name="active"/> <field name="active"/>
<field name="alias_email"/> <field name="alias_email" invisible="1"/>
<templates> <templates>
<t t-name="menu" groups="hr_recruitment.group_hr_recruitment_user"> <t t-name="menu" groups="hr_recruitment.group_hr_recruitment_user">
<div class="container"> <div class="container">
@ -288,7 +290,7 @@
<div class="small" groups="base.group_multi_company"> <div class="small" groups="base.group_multi_company">
<i class="fa fa-building-o" role="img" aria-label="Company" title="Company"/> <field name="company_id"/> <i class="fa fa-building-o" role="img" aria-label="Company" title="Company"/> <field name="company_id"/>
</div> </div>
<div t-if="record.alias_email.value" class="small o_job_alias"> <div t-if="record.alias_email.value" class="small o_job_alias" invisible="1">
<i class="fa fa-envelope-o" role="img" aria-label="Alias" title="Alias"/> <field name="alias_id"/> <i class="fa fa-envelope-o" role="img" aria-label="Alias" title="Alias"/> <field name="alias_id"/>
</div> </div>
</div> </div>