159 lines
6.5 KiB
Python
159 lines
6.5 KiB
Python
# -*- coding: utf-8 -*-
|
|
from odoo import api, fields, models, _
|
|
|
|
|
|
class YuthonEmergencyContactLine(models.Model):
|
|
_name = 'yuthon.emergency.contact.line'
|
|
_description = "紧急联系人明细行"
|
|
|
|
employee_id = fields.Many2one('hr.employee', string="关联员工")
|
|
message_login_id = fields.Many2one('yuthon.message.login', string="关联信息登记")
|
|
name = fields.Char(string="姓名")
|
|
user_sfz = fields.Char(string="身份证")
|
|
user_relationship = fields.Selection([("father", "父亲"),('mother', '母亲'), ("spouse", "妻子"), ('boys', '儿子'), ('daughter', '女儿'), ('didi', '弟弟'),
|
|
('husband', '丈夫'), ('sister', '姐姐'), ('brother', '哥哥'), ('sister_do', '妹妹')], string="关系")
|
|
workplace = fields.Char(string="工作单位")
|
|
post = fields.Char(string="岗位")
|
|
phone_number = fields.Char(string="手机号")
|
|
home_address = fields.Char(string="家庭住址")
|
|
documents_ids = fields.Many2many('ir.attachment', string="附件")
|
|
|
|
@api.model
|
|
def create(self, vals):
|
|
record = super().create(vals)
|
|
if record.employee_id:
|
|
record.employee_id.update_parental_leave()
|
|
return record
|
|
|
|
def write(self, vals):
|
|
res = super().write(vals)
|
|
for record in self:
|
|
if record.employee_id:
|
|
record.employee_id.update_parental_leave()
|
|
return res
|
|
|
|
def unlink(self):
|
|
employees = self.mapped('employee_id')
|
|
res = super().unlink()
|
|
for employee in employees:
|
|
if employee:
|
|
employee.update_parental_leave()
|
|
return res
|
|
|
|
|
|
class YuthonWorkExperienceLine(models.Model):
|
|
_name = 'yuthon.work.experience.line'
|
|
_description = "工作经验明细行"
|
|
|
|
employee_id = fields.Many2one('hr.employee', string="关联员工")
|
|
message_login_id = fields.Many2one('yuthon.message.login', string="关联信息登记")
|
|
start_date = fields.Date(string="开始日期")
|
|
end_date = fields.Date(string="结束日期")
|
|
work_place = fields.Char(string="工作单位")
|
|
post = fields.Char(string="岗位")
|
|
contact_user = fields.Char(string="联系人")
|
|
phone_number = fields.Char(string="联系人手机号")
|
|
reason_leaving = fields.Char(string="离职原因")
|
|
|
|
|
|
class YuthonEducationExperienceLine(models.Model):
|
|
_name = 'yuthon.education.experience.line'
|
|
_description = "教育经历明细行"
|
|
|
|
employee_id = fields.Many2one('hr.employee', string="关联员工")
|
|
message_login_id = fields.Many2one('yuthon.message.login', string="关联信息登记")
|
|
name_school = fields.Char(string="学校名称")
|
|
start_date = fields.Date(string="入学时间")
|
|
end_date = fields.Date(string="毕业时间")
|
|
in_school_duties = fields.Char(string="在校职务")
|
|
professional = fields.Char(string="专业")
|
|
learning_style = fields.Selection([
|
|
('full_time', '全日制'),
|
|
('upgrade', '专升本'),
|
|
('adult_education', '成人教育'),
|
|
('self_study', '自考'),
|
|
('online_education', '网络教育'),
|
|
('correspondence', '函授'),
|
|
], string="学习方式")
|
|
part_time_degree = fields.Char(string="学历")
|
|
full_time_degree = fields.Char(string="学位")
|
|
documents_ids = fields.Many2many('ir.attachment', string="附件")
|
|
|
|
|
|
class YuthonSkillsCertificatesLine(models.Model):
|
|
_name = 'yuthon.skills.certificates.line'
|
|
_description = "技能证书管理明细行"
|
|
|
|
employee_id = fields.Many2one('hr.employee', string="关联员工")
|
|
message_login_id = fields.Many2one('yuthon.message.login', string="关联信息登记")
|
|
rank_name = fields.Char(string='职级名称')
|
|
rank_type = fields.Char(string='职级类型')
|
|
rank_time = fields.Date(string='职级时间')
|
|
documents_ids = fields.Many2many('ir.attachment', string="附件")
|
|
|
|
|
|
class YuthonPersonalSkillsSchedule(models.Model):
|
|
_name = 'yuthon.personal.skills.schedule'
|
|
_description = "个人技能明细行"
|
|
|
|
message_login_id = fields.Many2one('yuthon.message.login', string="关联信息登记")
|
|
lingual = fields.Char(string='语种')
|
|
exam_grades = fields.Char(string='考试等级')
|
|
is_hear = fields.Boolean(string='听')
|
|
is_speak = fields.Boolean(string='说')
|
|
is_read = fields.Boolean(string='读')
|
|
is_write = fields.Boolean(string='写')
|
|
|
|
class YuthonDirectlyDetailLines(models.Model):
|
|
_name = 'yuthon.directly.detail.lines'
|
|
_description = "直属亲属明细行"
|
|
|
|
message_login_id = fields.Many2one('yuthon.message.login', string="关联信息登记")
|
|
name = fields.Char(string='姓名')
|
|
relational = fields.Selection([("parents", "父母"), ("children", "子女"),
|
|
("spouse", "配偶"), ("spouse", "其他")], string="关系")
|
|
workplace = fields.Char(string='工作单位及职务')
|
|
phone = fields.Char(string='联系电话')
|
|
email = fields.Char(string='邮箱')
|
|
|
|
class YuthonMostRecentWorkDetailLine(models.Model):
|
|
_name = 'yuthon.recent.work.detail.line'
|
|
_description = "最近工作经历明细行"
|
|
|
|
message_login_id = fields.Many2one('yuthon.message.login', string="关联信息登记") # 同上
|
|
position = fields.Char(string='单位名称')
|
|
post = fields.Char(string="岗位")
|
|
last_department = fields.Char(string='部门')
|
|
work_grades = fields.Char(string='工作内容成绩')
|
|
last_training = fields.Char(string='培训')
|
|
last_work_reason = fields.Char(string='离职原因')
|
|
|
|
class ChildCareLine(models.Model):
|
|
_name = 'child.care.line'
|
|
_description = "婴幼儿照护"
|
|
|
|
employee_id = fields.Many2one('hr.employee', string="关联员工")
|
|
name = fields.Char(string="姓名")
|
|
date = fields.Date(string="出生日期")
|
|
deduction = fields.Float(string="本人扣除比例")
|
|
|
|
|
|
class ChildEducationLine(models.Model):
|
|
_name = 'child.education.line'
|
|
_description = "子女教育"
|
|
|
|
employee_id = fields.Many2one('hr.employee', string="关联员工")
|
|
name = fields.Char(string="姓名")
|
|
start_date = fields.Date(string="教育开始日期")
|
|
end_date = fields.Date(string="教育结束日期")
|
|
deduction = fields.Float(string="本人扣除比例")
|
|
|
|
|
|
class ElderlySupportLine(models.Model):
|
|
_name = 'elderly.support.line'
|
|
_description = "赡养老人"
|
|
|
|
employee_id = fields.Many2one('hr.employee', string="关联员工")
|
|
name = fields.Char(string="姓名")
|
|
date = fields.Date(string="出生日期")
|
|
deduction = fields.Float(string="本人扣除比例") |