添加功能

This commit is contained in:
zhouzhou
2024-11-07 16:09:20 +08:00
parent 83fbafede7
commit fbd4efd310
5 changed files with 61 additions and 44 deletions
@@ -1,6 +1,6 @@
from odoo.http import Controller, request, route
from odoo import models, fields, api, http, SUPERUSER_ID, _
from datetime import date, datetime, time
class EmployeeLogin(Controller):
@@ -25,19 +25,22 @@ class EmployeeLogin(Controller):
if "phone" in values and values.get("phone", ""):
record.phone = values.get("phone", "")
if "email" in values and values.get("email", ""):
record.work_email = values.get("email", "")
record.email = values.get("email", "")
if "home_address" in values and values.get("home_address", ""):
record.home_address = values.get("home_address", "")
if "sex" in values and values.get("sex", ""):
record.sex = values.get("sex", "")
record.sex = values.get("sex") if values.get("sex") != "" else False
if "date_birth" in values and values.get("date_birth", ""):
record.date_birth = values.get("date_birth", "")
date_birth = values.get("date_birth", "")
record.date_birth = datetime.strptime(date_birth, '%Y-%m-%d').date()
if "party_time" in values and values.get("party_time", ""):
record.party_time = values.get("party_time", "")
party_time = values.get("party_time", "")
record.party_time = datetime.strptime(party_time, '%Y-%m-%d').date()
if "marital_status" in values and values.get("marital_status", ""):
record.marital_status = values.get("marital_status", "")
if "working_time" in values and values.get("working_time", ""):
record.working_time = values.get("working_time", "")
working_time = values.get("working_time", "")
record.working_time = datetime.strptime(working_time, '%Y-%m-%d').date()
if "home_phone" in values and values.get("home_phone", ""):
record.home_phone = values.get("home_phone", "")
if "origin" in values and values.get("origin", ""):
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models, _
class YuthonEmergencyContactLine(models.Model):
_name = 'yuthon.emergency.contact.line'
class HrYuthonEmergencyContactLine(models.Model):
_name = 'hr.yuthon.emergency.contact.line'
_description = "紧急联系人明细行"
employee_id = fields.Many2one('hr.employee', string="关联员工")
@@ -15,8 +15,8 @@ class YuthonEmergencyContactLine(models.Model):
phone_number = fields.Char(string="手机号")
home_address = fields.Char(string="家庭住址")
class YuthonWorkExperienceLine(models.Model):
_name = 'yuthon.work.experience.line'
class HrYuthonWorkExperienceLine(models.Model):
_name = 'hr.yuthon.work.experience.line'
_description = "工作经验明细行"
employee_id = fields.Many2one('hr.employee', string="关联员工")
@@ -30,8 +30,8 @@ class YuthonWorkExperienceLine(models.Model):
reason_leaving = fields.Char(string="离职原因")
class YuthonEducationExperienceLine(models.Model):
_name = 'yuthon.education.experience.line'
class HrYuthonEducationExperienceLine(models.Model):
_name = 'hr.yuthon.education.experience.line'
_description = "教育经历明细行"
employee_id = fields.Many2one('hr.employee', string="关联员工")
@@ -46,8 +46,8 @@ class YuthonEducationExperienceLine(models.Model):
major_courses = fields.Char(string="主修课程")
class YuthonPersonalSkillsSchedule(models.Model):
_name = 'yuthon.personal.skills.schedule'
class HrYuthonPersonalSkillsSchedule(models.Model):
_name = 'hr.yuthon.personal.skills.schedule'
_description = "个人技能明细行"
message_login_id = fields.Many2one('yuthon.message.login', string="关联信息登记")
@@ -58,8 +58,9 @@ class YuthonPersonalSkillsSchedule(models.Model):
is_read = fields.Boolean(string='读')
is_write = fields.Boolean(string='写')
class YuthonDirectlyDetailLines(models.Model):
_name = 'yuthon.directly.detail.lines'
class HrYuthonDirectlyDetailLines(models.Model):
_name = 'hr.yuthon.directly.detail.lines'
_description = "直属亲属明细行"
message_login_id = fields.Many2one('yuthon.message.login', string="关联信息登记")
@@ -70,8 +71,9 @@ class YuthonDirectlyDetailLines(models.Model):
phone = fields.Char(string='联系电话')
email = fields.Char(string='邮箱')
class YuthonMostRecentWorkDetailLine(models.Model):
_name = 'yuthon.recent.work.detail.line'
class HrYuthonMostRecentWorkDetailLine(models.Model):
_name = 'hr.yuthon.recent.work.detail.line'
_description = "最近工作经历明细行"
message_login_id = fields.Many2one('yuthon.message.login', string="关联信息登记")
@@ -128,7 +130,3 @@ class HrJobType(models.Model):
name = fields.Char(string="类别名称")
class YuthonPrepareApprovalLine(models.Model):
_name = 'yuthon.prepare.approval.line'
@@ -3,7 +3,7 @@ from odoo import models, fields, api
nation_list = [('a', '汉族'), ('b', '壮族'), ('v', '满族'), ('d', '回族'), ('e', '苗族'), ('f', '维吾尔族'),
('g', '土家族'), ('h', '彝族'), ('i', '蒙古族'), ('j', '藏族'), ('k', '布依族'), ('l', '侗族'),
('m', '瑶族'), ('n', '朝鲜族'), ('o', '白族'), ('p', '哈尼族'), ('q', '哈萨克族'), ('r', '黎族'),
('s', '傣族'), ('t', '畲族'), ('u', '傈僳族'), ('v', '仡佬族'), ('w', '东乡族'), ('x', '拉祜族'),
('s', '傣族'), ('t', '畲族'), ('u', '傈僳族'), ('v3', '仡佬族'), ('w', '东乡族'), ('x', '拉祜族'),
('y', '水族'), ('z', '佤族'), ('a1', '纳西族'), ('b1', '羌族'), ('c1', '仫佬族'), ('d1', '锡伯族'),
('e1', '柯尔克孜族'), ('f1', '达斡尔族'), ('g1', '景颇族'), ('h1', '毛南族'), ('i1', '撒拉族'),
('j1', '布朗族'), ('k1', '塔吉克族'), ('l1', '阿昌族'), ('m1', '普米族'), ('n1', '鄂温克族'), ('o1', '怒族'),
@@ -25,7 +25,7 @@ class YuthonMessageLogin(models.Model):
staff_name = fields.Char(string='姓名')
sex = fields.Selection([('male', '男'), ('female', '女')], string='性别')
date_birth = fields.Date(string='出生年月')
nation = fields.Selection(nation_list, string='民族')
nation = fields.Char(string='民族')
origin = fields.Char(string='籍贯')
political = fields.Selection([('cpc_dang', '中共党员'), ('nld', '民盟'),
('league_member', '共青团员'), ('people', '群众')], string="政治面貌")
@@ -86,21 +86,21 @@ class YuthonMessageLogin(models.Model):
related_issues_id = fields.Many2one('issue.library', string="关联议题")
# 紧急联系人
emergency_contact_ids = fields.One2many('yuthon.emergency.contact.line', 'message_login_id', string="紧急联系人明细行")
emergency_contact_ids = fields.One2many('hr.yuthon.emergency.contact.line', 'message_login_id', string="紧急联系人明细行")
# 教育经历
education_experience_ids = fields.One2many('yuthon.education.experience.line', 'message_login_id',string="教育经历明细行")
education_experience_ids = fields.One2many('hr.yuthon.education.experience.line', 'message_login_id',string="教育经历明细行")
# 工作经历
work_experience_ids = fields.One2many('yuthon.work.experience.line', 'message_login_id', string="工作经历明细行")
work_experience_ids = fields.One2many('hr.yuthon.work.experience.line', 'message_login_id', string="工作经历明细行")
# 直属亲属情况
direct_relative_ids = fields.One2many('yuthon.directly.detail.lines','message_login_id', string="直属亲属情况明细行")
direct_relative_ids = fields.One2many('hr.yuthon.directly.detail.lines','message_login_id', string="直属亲属情况明细行")
# 个人技能
personal_skill_ids = fields.One2many('yuthon.personal.skills.schedule','message_login_id', string="个人技能明细行")
personal_skill_ids = fields.One2many('hr.yuthon.personal.skills.schedule','message_login_id', string="个人技能明细行")
# 最近工作单位
last_work_unit_ids = fields.One2many('yuthon.recent.work.detail.line', 'message_login_id', string="最近工作单位情况")
last_work_unit_ids = fields.One2many('hr.yuthon.recent.work.detail.line', 'message_login_id', string="最近工作单位情况")
# 附件
attachment_ids = fields.One2many('education.details.line', 'diploma_id', string="学历证(全日制)")
part_time_ids = fields.One2many('education.details.line1', 'diploma_id', string="学历证(非全日制)")
degree_id_id = fields.One2many('education.details.line2', 'degree_id', string="学位证")
degree_id_ids = fields.One2many('education.details.line2', 'degree_id', string="学位证")
certificate_ids = fields.One2many('certificates.detail.line', 'certificate_id', string="专业证书")
def pub_name_button(self):
@@ -15,13 +15,10 @@ access_yuthon_salary_approval,yuthon_salary_approval,model_yuthon_salary_approva
access_yuthon_service_approval,yuthon_service_approval,model_yuthon_service_approval,base.group_user,1,1,1,1
access_yuthon_system_approval,yuthon_system_approval,model_yuthon_system_approval,base.group_user,1,1,1,1
access_yuthon_appointment_approval,yuthon_appointment_approval,model_yuthon_appointment_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_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_reward_punishment_details,yuthon_reward_punishment_details,model_yuthon_reward_punishment_details,base.group_user,1,1,1,1
access_hr_yuthon_personal_skills_schedule,hr_yuthon_personal_skills_schedule,model_hr_yuthon_personal_skills_schedule,base.group_user,1,1,1,1
access_hr_yuthon_directly_detail_lines,hr_yuthon_directly_degin_trgm_opstail_lines,model_hr_yuthon_directly_detail_lines,base.group_user,1,1,1,1
access_hr_yuthon_recent_work_detail_line,hr_yuthon_recent_work_detail_line,model_hr_yuthon_recent_work_detail_line,base.group_user,1,1,1,1
access_yuthon_appointment_result_line,yuthon_appointment_result_line,model_yuthon_appointment_result_line,base.group_user,1,1,1,1
access_yuthon_over_infor_detail_lines,yuthon_over_infor_detail_lines,model_yuthon_over_infor_detail_lines,base.group_user,1,1,1,1
access_education_details_line,education_details_line,model_education_details_line,base.group_user,1,1,1,1
access_education_details_line1,education_details_line1,model_education_details_line1,base.group_user,1,1,1,1
access_education_details_line2,education_details_line2,model_education_details_line2,base.group_user,1,1,1,1
@@ -32,5 +29,11 @@ access_yuthon_social_files_approval,yuthon_social_files_approval,model_yuthon_so
access_new_prepare_approval_line,new_prepare_approval_line,model_new_prepare_approval_line,base.group_user,1,1,1,1
access_interview_approval_line,interview_approval_line,model_interview_approval_line,base.group_user,1,1,1,1
access_prepare_approval_line,prepare_approval_line,model_prepare_approval_line,base.group_user,1,1,1,1
access_yuthon_prepare_approval_line,yuthon_prepare_approval_line,model_yuthon_prepare_approval_line,base.group_user,1,1,1,1
access_prepare_approval_line,prepare_approval_line,model_prepare_approval_line,base.group_user,1,1,1,1
access_yuthon_website_employee_wizard,yuthon_website_employee_wizard,model_yuthon_website_employee_wizard,base.group_user,1,1,1,1
access_hr_yuthon_education_experience_line,hr_yuthon_education_experience_line,model_hr_yuthon_education_experience_line,base.group_user,1,1,1,1
access_hr_yuthon_work_experience_line,hr_yuthon_work_experience_line,model_hr_yuthon_work_experience_line,base.group_user,1,1,1,1
access_hr_yuthon_emergency_contact_line,hr_yuthon_emergency_contact_line,model_hr_yuthon_emergency_contact_line,base.group_user,1,1,1,1
access_yuthon_over_infor_detail_lines,yuthon_over_infor_detail_lines,model_yuthon_over_infor_detail_lines,base.group_user,1,1,1,1
access_yuthon_reward_punishment_details,yuthon_reward_punishment_details,model_yuthon_reward_punishment_details,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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
15 access_yuthon_service_approval yuthon_service_approval model_yuthon_service_approval base.group_user 1 1 1 1
16 access_yuthon_system_approval yuthon_system_approval model_yuthon_system_approval base.group_user 1 1 1 1
17 access_yuthon_appointment_approval yuthon_appointment_approval model_yuthon_appointment_approval base.group_user 1 1 1 1
18 access_yuthon_personal_skills_schedule access_hr_yuthon_personal_skills_schedule yuthon_personal_skills_schedule hr_yuthon_personal_skills_schedule model_yuthon_personal_skills_schedule model_hr_yuthon_personal_skills_schedule base.group_user 1 1 1 1
19 access_yuthon_directly_detail_lines access_hr_yuthon_directly_detail_lines yuthon_directly_degin_trgm_opstail_lines hr_yuthon_directly_degin_trgm_opstail_lines model_yuthon_directly_detail_lines model_hr_yuthon_directly_detail_lines base.group_user 1 1 1 1
20 access_yuthon_recent_work_detail_line access_hr_yuthon_recent_work_detail_line yuthon_recent_work_detail_line hr_yuthon_recent_work_detail_line model_yuthon_recent_work_detail_line model_hr_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_reward_punishment_details yuthon_reward_punishment_details model_yuthon_reward_punishment_details base.group_user 1 1 1 1
21 access_yuthon_appointment_result_line yuthon_appointment_result_line model_yuthon_appointment_result_line base.group_user 1 1 1 1
access_yuthon_over_infor_detail_lines yuthon_over_infor_detail_lines model_yuthon_over_infor_detail_lines base.group_user 1 1 1 1
22 access_education_details_line education_details_line model_education_details_line base.group_user 1 1 1 1
23 access_education_details_line1 education_details_line1 model_education_details_line1 base.group_user 1 1 1 1
24 access_education_details_line2 education_details_line2 model_education_details_line2 base.group_user 1 1 1 1
29 access_new_prepare_approval_line new_prepare_approval_line model_new_prepare_approval_line base.group_user 1 1 1 1
30 access_interview_approval_line interview_approval_line model_interview_approval_line base.group_user 1 1 1 1
31 access_prepare_approval_line prepare_approval_line model_prepare_approval_line base.group_user 1 1 1 1
32 access_yuthon_prepare_approval_line access_prepare_approval_line yuthon_prepare_approval_line prepare_approval_line model_yuthon_prepare_approval_line model_prepare_approval_line base.group_user 1 1 1 1
33 access_yuthon_website_employee_wizard yuthon_website_employee_wizard model_yuthon_website_employee_wizard base.group_user 1 1 1 1
34 access_hr_yuthon_education_experience_line hr_yuthon_education_experience_line model_hr_yuthon_education_experience_line base.group_user 1 1 1 1
35 access_hr_yuthon_work_experience_line hr_yuthon_work_experience_line model_hr_yuthon_work_experience_line base.group_user 1 1 1 1
36 access_hr_yuthon_emergency_contact_line hr_yuthon_emergency_contact_line model_hr_yuthon_emergency_contact_line base.group_user 1 1 1 1
37 access_yuthon_over_infor_detail_lines yuthon_over_infor_detail_lines model_yuthon_over_infor_detail_lines base.group_user 1 1 1 1
38 access_yuthon_reward_punishment_details yuthon_reward_punishment_details model_yuthon_reward_punishment_details base.group_user 1 1 1 1
39 access_yuthon_trial_scenario_detail_line yuthon_trial_scenario_detail_line model_yuthon_trial_scenario_detail_line base.group_user 1 1 1 1
@@ -79,20 +79,29 @@
<div class="mb-3 field-room_id">
<div class="mb-3 field-room_id">
<label for="marital_status" class="form-label">婚姻状况</label>
<select name="marital_status" id="marital_status" t-attf-class="form-control" style="background-color:#eee;">
<select name="marital_status" id="marital_status" t-attf-class="form-control"
style="background-color:#eee;">
<option value=""> </option>
<option value="married">已婚</option>
<option value="unmarried">未婚</option>
</select>
</div>
</div>
<div class="mb-3 field-room_id">
<label for="home_phone" class="form-label">家庭电话</label>
<input type="text" placeholder="家庭电话" name="home_phone" t-att-value="home_phone"
id="home_phone" t-attf-class="form-control" style="background-color:#eee;"/>
</div>
<div class="mb-3 field-room_id">
<label for="nation" class="form-label">民族</label>
<input type="text" placeholder="民族" name="nation" t-att-value="nation"
id="nation" t-attf-class="form-control" style="background-color:#eee;"/>
<input type="text" name="nation" id="nation"
t-attf-class="form-control" style="background-color:#eee;"/>
</div>
<div class="mb-3 field-room_id">
<label for="house_type" class="form-label">户口类型</label>
<select name="house_type" id="house_type" t-attf-class="form-control" style="background-color:#eee;">
<select name="house_type" id="house_type" t-attf-class="form-control"
style="background-color:#eee;">
<option value=""> </option>
<option value="city">城市</option>
<option value="rural">农村</option>
</select>
@@ -102,13 +111,16 @@
<div class="mb-3 field-room_id">
<label for="sex" class="form-label">性别</label>
<select name="sex" id="sex" t-attf-class="form-control" style="background-color:#eee;">
<option value=""> </option>
<option value="male">男</option>
<option value="female">女</option>
</select>
</div>
<div class="mb-3 field-room_id">
<label for="political" class="form-label">政治面貌</label>
<select name="political" id="political" t-attf-class="form-control" style="background-color:#eee;">
<select name="political" id="political" t-attf-class="form-control"
style="background-color:#eee;">
<option value=""> </option>
<option value="cpc_dang">中共党员</option>
<option value="nld">民盟</option>
<option value="league_member">共青团员</option>
@@ -127,7 +139,8 @@
</div>
<div class="mb-3 field-room_id">
<label for="working_time" class="form-label">参与工作时间</label>
<input type="date" name="working_time" id="working_time" t-attf-class="form-control" style="background-color:#eee;"/>
<input type="date" name="working_time" id="working_time" t-attf-class="form-control"
style="background-color:#eee;"/>
</div>
<div class="mb-3 field-room_id">
<label for="origin" class="form-label">籍贯</label>