添加功能

This commit is contained in:
zhouzhou
2024-09-20 19:21:27 +08:00
parent 0311350c57
commit aafa9f0004
16 changed files with 246 additions and 110 deletions
@@ -5,39 +5,19 @@ class HrApplicant(models.Model):
_inherit = "hr.applicant"
#基础信息
job_lv_id = fields.Many2one('yuthon.job.lv', string="职级")
is_recruitment_status = fields.Boolean(string="招聘状态")
job_type_id = fields.Many2one('hr.job.type', string="岗位类别")
affiliation = fields.Char(string="所属单位")
#任职要求
education = fields.Char(string="学历")
approval_sex = fields.Selection([('girl', '女'), ('boy', '男')], string="性别")
age_start = fields.Integer(string="年龄")
age_end = fields.Integer(string="年龄")
political_aspects = fields.Selection([('cpc_dang', '中共党员'), ('nld', '民盟'),
('league_member', '共青团员'), ('people', '群众')], string="政治面貌")
professional = fields.Char(string="专业")
title = fields.Char(string="职称")
admissions = fields.Char(string="执业资格")
years_of_service = fields.Integer(string="工作年限")
competency_requirements = fields.Text(string="能力要求")
other_notes = fields.Text(string="其他要求说明")
takes_time = fields.Date(string="需要时间")
colleges = fields.Char(string="院校")
degree_id = fields.Selection([('high', '高中'), ('junior_college', '大专'), ('bachelor', '本科'),
('master', '硕士'), ('doctor', '博士')], string="学历")
major = fields.Char(string="专业")
years_of_service = fields.Char(string="工作年限")
original_position = fields.Char(string='原工作岗位')
previous_position = fields.Char(string='原职务')
status_first = fields.Selection([('in_service', '尚在职'), ('retired', '办理离职'), ('leaving', '已离职')] ,string='现就业状态')
contract_documents_ids = fields.Many2many('documents.document', string="附件")
#招聘信息
date_of_filing = fields.Date(string="申报日期")
reason_recruitment = fields.Char(string="招聘事由")
ideal_date = fields.Date(string="希望到岗日期")
recruit_start_date = fields.Date(string="招聘开始日期")
recruit_end_date = fields.Date(string="招聘截止日期")
recruit_over_date = fields.Date(string="招聘结束日期")
recruit_priority = fields.Selection([('high', '高'), ('middle', '中'), ('low', '低')], string="招聘优先级")
people_needed = fields.Integer(string="需要编内人数")
people_needed_outside = fields.Integer(string="需要编外人数")
place_work = fields.Char(string="工作地点")
is_referral = fields.Boolean(string="允许员工推荐")
job_description = fields.Text(string="招聘情况说明")
publish_applicant_ids = fields.Many2many('publish.applicant.setting', string="招聘发布途径")
@@ -19,6 +19,35 @@ class HrJob(models.Model):
establishment_quotas = fields.Integer(string="编制定员")
job_personnel = fields.Char(string="在岗人员")
remarks = fields.Text(string="备注")
is_recruitment_status = fields.Boolean(string="招聘状态")
#任职要求
degree = fields.Selection([('high', '高中'), ('junior_college', '大专'), ('bachelor', '本科'),
('master', '硕士'), ('doctor', '博士')], string="学历")
approval_sex = fields.Selection([('girl', '女'), ('boy', '男')], string="性别")
age_start = fields.Integer(string="年龄")
age_end = fields.Integer(string="年龄")
political_aspects = fields.Selection([('cpc_dang', '中共党员'), ('nld', '民盟'),
('league_member', '共青团员'), ('people', '群众')], string="政治面貌")
professional = fields.Char(string="专业")
title = fields.Char(string="职称")
admissions = fields.Char(string="执业资格")
years_of_service = fields.Integer(string="工作年限")
competency_requirements = fields.Text(string="能力要求")
other_notes = fields.Text(string="其他要求说明")
#招聘信息
date_of_filing = fields.Date(string="申报日期")
reason_recruitment = fields.Char(string="招聘事由")
ideal_date = fields.Date(string="希望到岗日期")
recruit_start_date = fields.Date(string="招聘开始日期")
recruit_end_date = fields.Date(string="招聘截止日期")
recruit_over_date = fields.Date(string="招聘结束日期")
recruit_priority = fields.Selection([('high', '高'), ('middle', '中'), ('low', '低')], string="招聘优先级")
place_work = fields.Char(string="工作地点")
is_referral = fields.Boolean(string="允许员工推荐")
job_description = fields.Text(string="招聘情况说明")
publish_applicant_ids = fields.Many2many('publish.applicant.setting', string="招聘发布途径")
@api.depends('establishment_quotas', 'no_of_employee')
def _compute_compiling_status(self):
@@ -5,96 +5,41 @@
<field name="model">hr.applicant</field>
<field name="inherit_id" ref="hr_recruitment.hr_applicant_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="attributes">
<attribute name="string">岗位</attribute>
</xpath>
<xpath expr="//field[@name='type_id']" position="attributes">
<attribute name="string">最低学历</attribute>
</xpath>
<xpath expr="//form[@class='o_applicant_form']" position="replace">
<form class="o_applicant_form">
<div class="col-12 text-center">
<h1>
招聘信息
<field name="partner_name" required="1"/>
</h1>
</div>
<group col="4" string="基本信息">
<group>
<field name="name" required="1" string="岗位"/>
<field name="affiliation"/>
<field name="partner_name" required="1" string="姓名"/>
<field name="job_id" required="1" string="岗位"/>
<field name="takes_time"/>
<field name="stage_id"/>
</group>
<group>
<field name="department_id"/>
<field name="colleges"/>
<field name="department_id" string="部门"/>
<field name="company_id"/>
</group>
<group>
<field name="job_lv_id"/>
<field name="job_type_id"/>
<field name="degree_id"/>
<field name="major"/>
<field name="years_of_service"/>
</group>
<group>
<field name="is_recruitment_status"/>
</group>
</group>
<group col="3" string="任职要求">
<group>
<field name="education"/>
<field name="approval_sex"/>
</group>
<group>
<field name="political_aspects"/>
<field name="admissions"/>
</group>
<group>
<field name="professional"/>
<field name="title"/>
<field name="original_position"/>
<field name="previous_position"/>
<field name="status_first"/>
</group>
</group>
<group>
<group>
<label for="age_start"/>
<div>
<field name="age_start" class="oe_inline"/>至<field name="age_end" class="oe_inline"/>
</div>
</group>
<group>
<label for="years_of_service"/>
<div>
<field name="years_of_service" class="oe_inline"/>年及以上
</div>
</group>
</group>
<group>
<field name="competency_requirements"/>
<field name="other_notes"/>
</group>
<group string="招聘信息" col="4">
<group>
<field name="partner_name" required="1"/>
<field name="recruit_start_date"/>
<field name="people_needed"/>
</group>
<group>
<field name="date_of_filing"/>
<field name="recruit_end_date"/>
<field name="people_needed_outside"/>
</group>
<group>
<field name="reason_recruitment"/>
<field name="recruit_over_date"/>
<field name="place_work"/>
</group>
<group>
<field name="ideal_date"/>
<field name="recruit_priority"/>
<field name="is_referral"/>
</group>
</group>
<group>
<field name="job_description"/>
<field name="publish_applicant_ids" widget="many2many_tags"/>
<field name="contract_documents_ids"/>
</group>
</form>
</xpath>
</field>
</record>
</odoo>
@@ -50,6 +50,42 @@
<field name="model">hr.job</field>
<field name="inherit_id" ref="hr.view_hr_job_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='recruitment_page']" position="attributes">
<attribute name="string">基础信息</attribute>
</xpath>
<xpath expr="//page[@name='job_description_page']" position="attributes">
<attribute name="string">任职要求</attribute>
</xpath>
<xpath expr="//page[@name='job_description_page']" position="after">
<page string="招聘信息">
<group col="4">
<group>
<field name="user_id" required="1" string="申报员"/>
<field name="recruit_start_date"/>
<field name="compiling_external"/>
</group>
<group>
<field name="date_of_filing"/>
<field name="recruit_end_date"/>
<field name="establishment_quotas"/>
</group>
<group>
<field name="reason_recruitment"/>
<field name="recruit_over_date"/>
<field name="place_work"/>
</group>
<group>
<field name="ideal_date"/>
<field name="recruit_priority"/>
<field name="is_referral"/>
</group>
</group>
<group>
<field name="job_description"/>
<field name="publish_applicant_ids" widget="many2many_tags"/>
</group>
</page>
</xpath>
<xpath expr="//field[@name='department_id']" position="after">
<field name="job_type_id"/>
<field name="establishment_quotas"/>
@@ -14,6 +14,9 @@
'depends':['base', 'hr', 'yuthon_hr_employee', 'soong_workflow', 'documents','hr_recruitment'],
'data': [
'security/ir.model.access.csv',
'data/process_code_data.xml',
'data/tage_approval_data.xml',
'views/inherit_hr_applicant_views.xml',
'views/inherit_hr_job_views.xml',
'views/yuthon_message_login_views.xml',
'views/yuthon_onboard_approval_views.xml',
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="tage_approval_setting_sequence0" model="hr.applicant.category">
<field name="name">求职意向高</field>
</record>
<record id="tage_approval_setting_sequence1" model="hr.applicant.category">
<field name="name">可随时入职</field>
</record>
<record id="tage_approval_setting_sequence2" model="hr.applicant.category">
<field name="name">薪资可满足</field>
</record>
<record id="tage_approval_setting_sequence3" model="hr.applicant.category">
<field name="name">能力匹配</field>
</record>
<record id="tage_approval_setting_sequence4" model="hr.applicant.category">
<field name="name">专业对口</field>
</record>
<record id="tage_approval_setting_sequence5" model="hr.applicant.category">
<field name="name">经验丰富</field>
</record>
</odoo>
@@ -1,5 +1,6 @@
from . import hr_employee_page
from . import inherit_hr_job
from . import inherit_hr_applicant
from . import yuthon_message_login
from . import yuthon_onboard_approval
from . import yuthon_account_approval
@@ -73,6 +73,29 @@ class YuthoJobRequirementDetailLine(models.Model):
recruitment_ids = fields.One2many('hr.job', 'recruitment_approval_id', string="招聘申请")
class YuthonInterviewInformationDetailLine(models.Model):
_name = "yuthon.interview.detail.line"
_description = "面试信息明细行"
interview_id = fields.Many2one('yuthon.interview.approval', string="关联面试信息")
recruiters_name = fields.Char(string='姓名')
colleges = fields.Char(string='院校')
degree = fields.Selection([('high', '高中'), ('junior_college', '大专'), ('bachelor', '本科'),
('master', '硕士'), ('doctor', '博士')], string="学历")
major = fields.Char(string='专业')
years_of_service = fields.Char(string='工作年限')
original_position = fields.Char(string='原工作岗位')
previous_position = fields.Char(string='原职务')
status_first = fields.Selection([('in_service', '尚在职'), ('retired', '办理离职'), ('leaving', '已离职')] ,string='现就业状态')
contract_documents_ids = fields.Many2many('documents.document', string="附件")
interviewer = fields.Many2one('hr.employee', string='面试官')
interview_time = fields.Datetime(string='面试时间')
location = fields.Char(string='地点')
interview_results = fields.Selection([('pass', '通过'), ('fail', '不通过')], string="面试结果")
tage_ids = fields.Many2many('hr.applicant.category', string="应聘标签")
class HrJobType(models.Model):
_name = "hr.job.type"
@@ -0,0 +1,39 @@
from odoo import api, fields, models, _
class HrApplicant(models.Model):
_inherit = 'hr.applicant'
def pub_interview_approval(self):
stage_id_to_selection_mapping = {
2: 'first',
3: 'second',
4: 'end',
}
default_interview_stage = stage_id_to_selection_mapping.get(self.stage_id.id)
# ... existing code ...
hr_applicant_ids = self.env["hr.applicant"].browse(self._context.get('active_ids', self._context.get('active_id')))
hr_applicant_data = []
for job in hr_applicant_ids:
hr_applicant_data.append((0, 0, {
'major' :job.major,
'degree':job.degree_id,
'recruiters_name':job.partner_name,
'years_of_service':job.years_of_service
}
))
form_id = self.env.ref("yuthon_hr_employee_approval.view_yuthon_interview_approval_form").id
return {
'type': 'ir.actions.act_window',
'name': '提交面试申请',
'res_model': 'yuthon.interview.approval',
"views": [[form_id, "form"]],
"context": {
'default_interview_stage': default_interview_stage,
'default_job_applying' : self.job_id.id,
'default_department': self.department_id.id,
'default_interview_ids': hr_applicant_data,
}
}
@@ -80,4 +80,4 @@ class HrJob(models.Model):
'default_name': f'{self.department_id.name}部门编制调制申请表',
'default_adjust_information_ids': hr_job_data,
}
}
}
@@ -8,4 +8,9 @@ class YuthonInterviewApproval(models.Model):
name = fields.Char(string='名称')
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_interview_approval_code'))
interview_stage = fields.Selection([('first', '初试'), ('second', '复试'), ('end','终试')], string="面试阶段")
job_id = fields.Many2one('hr.job', string='应聘岗位')
department_id = fields.Many2one("hr.department", string="应聘职务", required=True)
code = fields.Char(string="面试表编号", default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_interview_approval_code'))
interview_ids = fields.One2many('yuthon.interview.detail.line', 'interview_id', string='应聘面试信息')
@@ -16,6 +16,8 @@ access_yuthon_service_approval,yuthon_service_approval,model_yuthon_service_appr
access_yuthon_system_approval,yuthon_system_approval,model_yuthon_system_approval,base.group_user,1,1,1,1
access_yuthon_title_approval,yuthon_title_approval,model_yuthon_title_approval,base.group_user,1,1,1,1
access_yuthon_personal_skills_schedule,yuthon_personal_skills_schedule,model_yuthon_personal_skills_schedule,base.group_user,1,1,1,1
access_yuthon_directly_detail_lines,yuthon_directly_detail_lines,model_yuthon_directly_detail_lines,base.group_user,1,1,1,1
access_yuthon_directly_detail_lines,yuthon_directly_degin_trgm_opstail_lines,model_yuthon_directly_detail_lines,base.group_user,1,1,1,1
access_yuthon_recent_work_detail_line,yuthon_recent_work_detail_line,model_yuthon_recent_work_detail_line,base.group_user,1,1,1,1
access_yuthon_trial_scenario_detail_line,yuthon_trial_scenario_detail_line,model_yuthon_trial_scenario_detail_line,base.group_user,1,1,1,1
access_yuthon_job_requirement_detail_line,yuthon_job_requirement_detail_line,model_yuthon_job_requirement_detail_line,base.group_user,1,1,1,1
access_yuthon_interview_detail_line,yuthon_interview_detail_line,model_yuthon_interview_detail_line,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
16 access_yuthon_system_approval yuthon_system_approval model_yuthon_system_approval base.group_user 1 1 1 1
17 access_yuthon_title_approval yuthon_title_approval model_yuthon_title_approval base.group_user 1 1 1 1
18 access_yuthon_personal_skills_schedule yuthon_personal_skills_schedule model_yuthon_personal_skills_schedule base.group_user 1 1 1 1
19 access_yuthon_directly_detail_lines yuthon_directly_detail_lines yuthon_directly_degin_trgm_opstail_lines model_yuthon_directly_detail_lines base.group_user 1 1 1 1
20 access_yuthon_recent_work_detail_line yuthon_recent_work_detail_line model_yuthon_recent_work_detail_line base.group_user 1 1 1 1
21 access_yuthon_trial_scenario_detail_line yuthon_trial_scenario_detail_line model_yuthon_trial_scenario_detail_line base.group_user 1 1 1 1
22 access_yuthon_job_requirement_detail_line yuthon_job_requirement_detail_line model_yuthon_job_requirement_detail_line base.group_user 1 1 1 1
23 access_yuthon_interview_detail_line yuthon_interview_detail_line model_yuthon_interview_detail_line base.group_user 1 1 1 1
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="inherit_hr_applicant_approval_tree" model="ir.ui.view">
<field name="name">inherit.hr.applicant.approval.tree</field>
<field name="model">hr.applicant</field>
<field name="inherit_id" ref="hr_recruitment.crm_case_tree_view_job"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="inside">
<header>
<button name="pub_interview_approval" string="提交面试申请" type="object"/>
</header>
</xpath>
</field>
</record>
</odoo>
@@ -6,6 +6,10 @@
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="code"/>
<field name="job_id"/>
<field name="interview_stage"/>
<field name="department_id"/>
</tree>
</field>
</record>
@@ -15,10 +19,43 @@
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="name"/>
<field name="code"/>
<div class="col-12 text-center">
<h1>
<field name="name" required="1"/>
</h1>
</div>
<group col="2">
<group>
<field name="interview_stage"/>
<field name="job_id"/>
</group>
<group>
<field name="code"/>
<field name="department_id"/>
</group>
</group>
<notebook>
<page string="应聘面试信息">
<field name="interview_ids">
<tree editable="bottom">
<field name="recruiters_name"/>
<field name="colleges"/>
<field name="degree"/>
<field name="major"/>
<field name="years_of_service"/>
<field name="original_position"/>
<field name="previous_position"/>
<field name="status_first"/>
<field name="contract_documents_ids"/>
<field name="interviewer"/>
<field name="interview_time"/>
<field name="location"/>
<field name="tage_ids" widget="many2many_tags"/>
<field name="interview_results"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
@@ -27,7 +64,7 @@
<record id="yuthon_interview_approval_action" model="ir.actions.act_window">
<field name="name">待开发</field>
<field name="name">面试申请表</field>
<field name="res_model">yuthon.interview.approval</field>
<field name="view_mode">tree,form</field>
</record>
@@ -80,7 +80,7 @@
<record id="yuthon_recruitment_approval_action" model="ir.actions.act_window">
<field name="name">招聘需要申请表</field>
<field name="name">招聘需求申请表</field>
<field name="res_model">yuthon.recruitment.approval</field>
<field name="view_mode">tree,form</field>
</record>
+1 -1
View File
@@ -75,7 +75,7 @@
<menuitem id="hr_menu_interview_approval_root_board"
name="面试信息表"
parent="hr_process_work_job_menu_board"
action="yuthon_none_action"
action="yuthon_hr_employee_approval.yuthon_interview_approval_action"
sequence="5"/>
<menuitem id="hr_process_onboard_menu_root_board"
name="入职申请表"