Merge pull request !614 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2024-11-29 10:58:38 +00:00
committed by Gitee
35 changed files with 79 additions and 359 deletions
+18 -1
View File
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models, _
from pypinyin import pinyin,lazy_pinyin
from odoo.osv import expression
class YuthonUserRole(models.Model):
@@ -18,6 +20,7 @@ class YuthonUserRole(models.Model):
child_ids = fields.One2many('soong.user.role', 'parent_id', string='子集角色')
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
('thlc', '天河粮储'), ('thtjbb', '天河投资本部')], string="所属公司", compute='compute_company')
pinyin_name = fields.Char(string="拼音名称", compute='_compute_pinyin', index=True, store=True)
@api.depends('department_id')
def compute_company(self):
@@ -38,4 +41,18 @@ class YuthonUserRole(models.Model):
break
department = department.parent_id
else:
record.yuthon_company = 'thtz'
record.yuthon_company = 'thtz'
@api.depends('name')
def _compute_pinyin(self):
for employee in self:
employee.pinyin_name = ''.join(lazy_pinyin(employee.name))
@api.model
def _name_search(self, name, domain=None, operator='ilike', limit=None, order=None):
domain = domain or []
if name:
input_pinyin = ''.join(lazy_pinyin(name))
search_domain = ['|', ('pinyin_name', operator, input_pinyin), ('name', operator, name)]
domain = expression.AND([search_domain, domain])
return self._search(domain, limit=limit, order=order)
@@ -10,6 +10,7 @@
<field name="name" required="1"/>
<field name="user_type"/>
<field name="department_id"/>
<field name="pinyin_name" column_invisible="1"/>
<field name="parent_id"/>
<field name="child_ids" column_invisible="1"/>
<field name="yuthon_company" readonly="0"/>
@@ -7,16 +7,9 @@ class HrContract(models.Model):
_inherit = "hr.contract"
_description = "员工合同拓展"
job_lv_id = fields.Many2one(related='employee_id.job_lv_id', string="职级")
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('contract_code'))
resource_calendar_id = fields.Many2one('resource.calendar', string='考勤时间表')
@api.onchange('job_lv_id')
def onchange_salary(self):
for salary in self:
salary.wage = salary.job_lv_id.base_wage
salary.name = '劳动合同'
work_entry_source = fields.Selection([
('calendar', '考勤安排'),
('attendance', 'Attendances'),
@@ -6,7 +6,6 @@
<field name="inherit_id" ref="hr_contract.hr_contract_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='employee_id']" position="after">
<field name="job_lv_id"/>
<field name="code"/>
</xpath>
<xpath expr="//page[@name='information']" position="replace">
-4
View File
@@ -13,19 +13,15 @@
'website': 'https://www.pengyuthon.com',
'depends': ['base', 'hr', 'hr_recruitment', 'soong_workflow','documents'],
'data': [
'data/yuthon.job.lv.csv',
'data/job_lv_groups_data.xml',
'data/employee_code_data.xml',
'data/abnormal_time_data.xml',
'data/applicant_tage_setting_data.xml',
'data/employee_recruitment_time_data.xml',
'data/publish_applicant_setting_data.xml',
'security/ir.model.access.csv',
'security/job_lv_security_group.xml',
'security/hr_job_company_security_group.xml',
'views/yuthon_hr_employee_views.xml',
'views/yuthon_hr_department_views.xml',
'views/yuthon_job_lv_views.xml',
'views/applicant_tage_setting_views.xml',
'views/inherit_res_user_views.xml',
'views/hr_job_type_views.xml',
@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="job_lv_setting_sequence1" model="soong.user.role">
<field name="name">职级管理员</field>
<field name="user_type">departmental_role</field>
</record>
<record id="job_lv_setting_sequence2" model="soong.user.role">
<field name="name">天河投资职级</field>
<field name="user_type">departmental_role</field>
</record>
<record id="job_lv_setting_sequence3" model="soong.user.role">
<field name="name">天河物管职级</field>
<field name="user_type">departmental_role</field>
</record>
<record id="job_lv_setting_sequence4" model="soong.user.role">
<field name="name">天河粮储职级</field>
<field name="user_type">departmental_role</field>
</record>
</odoo>
-1
View File
@@ -8,5 +8,4 @@ from . import inherit_hr_applicant
from . import applicant_tage_setting
from . import publish_applicant_setting
from . import yuthon_job_postings
from . import inherit_hr_employee
@@ -1,29 +0,0 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models
class YuthonHrEmployee(models.Model):
_inherit = "hr.employee"
user_role_ids_changed = fields.Boolean(compute='_compute_user_roles')
@api.depends('user_role_ids')
def _compute_job_lv_roles(self):
group_mapping = {
'职级管理员': 'group_topic_admin',
'天河投资职级': 'group_party_topic',
'天河物管职级': 'group_team_topic',
'天河粮储职级': 'group_board_topic',
}
old_users_ids = self.user_role_ids
for employee in self:
for role in employee.user_role_ids:
group_id = group_mapping.get(role.name)
if group_id:
group = self.env.ref('yuthon_issue.' + group_id, raise_if_not_found=False)
if group:
# 未知因素屏蔽选择值
group.write({'users': [(4, employee.user_id.id)]})
self.user_role_ids = old_users_ids
self.user_role_ids_changed = True
@@ -16,7 +16,6 @@ class HrJob(models.Model):
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
('thlc', '天河粮储'), ('thtjbb', '天河投资本部')], string="所属公司")
job_type_id = fields.Many2one('hr.job.type', string="岗位类别")
job_lv_id = fields.Many2one('yuthon.job.lv', string="职级")
start_date = fields.Date(string="生效日期", default=lambda self: fields.Date.today())
end_date = fields.Date(string="失效日期", default=fields.Date.from_string('2099-01-01'))
is_enable = fields.Boolean(string="是否启用", default=False, compute='compute_is_enable', store=True)
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models
from pypinyin import pinyin,lazy_pinyin
from odoo.osv import expression
class YuthonHrDepartment(models.Model):
_inherit = "hr.department"
@@ -19,6 +20,7 @@ class YuthonHrDepartment(models.Model):
end_date = fields.Date(string="结束时间")
department_code = fields.Char(string="部门序号")
# lower_ids = fields.One2many('hr.department', 'parent_id', string="下级部门")
pinyin_name = fields.Char(string="拼音名称", compute='_compute_pinyin', index=True, store=True)
@api.onchange('department_code', 'parent_id')
def _onchange_department_code(self):
@@ -38,3 +40,19 @@ class YuthonHrDepartment(models.Model):
#
# cycle_code(self, self.department_code)
@api.depends('name')
def _compute_pinyin(self):
for employee in self:
employee.pinyin_name = ''.join(lazy_pinyin(employee.name))
@api.model
def _name_search(self, name, domain=None, operator='ilike', limit=None, order=None):
domain = domain or []
if name:
input_pinyin = ''.join(lazy_pinyin(name))
search_domain = ['|', ('pinyin_name', operator, input_pinyin), ('name', operator, name)]
domain = expression.AND([search_domain, domain])
return self._search(domain, limit=limit, order=order)
@@ -32,7 +32,7 @@ class YuthonHrEmployee(models.Model):
user_number = fields.Char(string="员工编号", default=lambda self: self.env['ir.sequence'].next_by_code('employee_code'))
use_user_type = fields.Selection([('formal', '正式合同'), ('labor', '劳务协议'),
('part_time', '兼职协议'), ('employment', '用工协议'), ('internship', '实习协议')], string="用工形式")
job_lv_id = fields.Many2one('yuthon.job.lv', string="最新职级")
contract_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
('thlc', '天河粮储')], default='thtz', string="合同所属公司")
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
+1 -47
View File
@@ -10,50 +10,4 @@ class YuthonJobLv(models.Model):
_description = "职级管理"
_order = 'sequence asc'
lv = fields.Char(string="级别")
sequence = fields.Char(string='级别序号', store=True)
name = fields.Char(string="职级名称")
base_wage = fields.Float(string="基本工资", group_operator=None)
job_wage = fields.Float(string="职级工资", group_operator=None)
post_wage = fields.Float(string="岗位工资", group_operator=None)
performance_bonus = fields.Float(string="绩效奖金", group_operator=None)
phone_subsidy = fields.Float(string="通信补贴", group_operator=None)
attendance_bonus = fields.Float(string="全勤奖", group_operator=None)
all_wage = fields.Float(string="应发工资", group_operator=None)
comprehensive_subsidy = fields.Float(string="综合补贴", group_operator=None)
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
create_time = fields.Datetime(string="生效日期", default=fields.Datetime.now)
end_time = fields.Datetime(string="失效日期")
#天河粮储
post_subsidy = fields.Float(string="岗位补贴(原职级工资)", group_operator=None)
monthly_performance = fields.Float(string="月度绩效", group_operator=None)
duty_pay = fields.Float(string="值班费", group_operator=None)
assignment_subsidy = fields.Float(string="作业环境补贴", group_operator=None)
temporary_performance = fields.Float(string="临时绩效补贴", group_operator=None)
@api.model
def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True):
res = super(YuthonJobLv, self).read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby,
lazy=lazy)
if 'lv' in groupby:
def sort_by_sequence_number(item):
lv = item.get('lv')
if lv:
rec = self.search([('lv', '=', lv)], limit=1)
if rec and rec.sequence:
match = re.findall(r'\d+', rec.sequence)
if match:
number_str = "".join(match)
try:
number = int(number_str)
return (not number_str.startswith('0'), number) # 取反,首位为0的在前面
except ValueError:
return (False, 0) # 首位非0的放前面
return (False, 0) # 首位非0的放前面
res.sort(key=sort_by_sequence_number)
return res
@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="module_category_yuthon_job_lv" model="ir.module.category">
<field name="name">职级权限</field>
</record>
<!-- 天河投资职级群组 -->
<record id="group_party_topic_lv" model="res.groups">
<field name="name">天河投资职级</field>
<field name="category_id" ref="module_category_yuthon_job_lv"/>
</record>
<!-- 天河物管职级群组 -->
<record id="group_team_topic_lv" model="res.groups">
<field name="name">天河物管职级</field>
<field name="category_id" ref="module_category_yuthon_job_lv"/>
</record>
<!-- 天河粮储职级群组 -->
<record id="group_board_topic_lv" model="res.groups">
<field name="name">天河粮储职级</field>
<field name="category_id" ref="module_category_yuthon_job_lv"/>
</record>
<!-- 职级群组 -->
<record id="group_topic_admin_lv" model="res.groups">
<field name="name">职级管理员</field>
<field name="category_id" ref="module_category_yuthon_job_lv"/>
<field name="implied_ids" eval="[(4, ref('group_party_topic_lv')), (4, ref('group_team_topic_lv')), (4, ref('group_board_topic_lv'))]"/>
<field name="users" eval="[(4, ref('base.user_admin'))]"/>
</record>
</odoo>
@@ -21,6 +21,7 @@
<xpath expr="//field[@name='name']" position="after">
<field name="department_code"/>
<field name="department_phone"/>
<field name="pinyin_name" column_invisible="1"/>
<field name="department_fax" column_invisible="1"/>
<field name="department_location"/>
<field name="parent_id" string="上级部门"/>
@@ -112,7 +112,6 @@
<field name="number"/>
<field name="user_number"/>
<field name="use_user_type"/>
<field name="job_lv_id"/>
</xpath>
<xpath expr="//group[@name='active_group']" position="after">
<group string="工作信息">
@@ -226,8 +225,8 @@
<field name="yuthon_company" optional="hide"/>
<field name="use_user_type"/>
<field name="user_number" optional="hide"/>
<field name="job_lv_id"/>
<field name="entry_date"/>
<field name="mobile_phone"/>
<field name="confirmation_date" optional="hide"/>
<field name="user_number_start_time" optional="hide"/>
<field name="nation" optional="hide"/>
@@ -253,6 +252,9 @@
<xpath expr="//field[@name='name']" position="after">
<field name="number"/>
</xpath>
<xpath expr="//field[@name='first_contract_date']" position="attributes">
<attribute name="optional">hide</attribute>
</xpath>
</field>
</record>
<record id="all_data_write_user" model="ir.actions.server">
@@ -1,133 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- 全部 -->
<record id="view_yuthon_job_lv_tree" model="ir.ui.view">
<field name="name">yuthon.job.lv.tree</field>
<field name="model">yuthon.job.lv</field>
<field name="arch" type="xml">
<tree editable="bottom">
<field name="sequence"/>
<field name="lv"/>
<field name="name"/>
<field name="base_wage"/>
<field name="job_wage"/>
<field name="post_wage"/>
<field name="performance_bonus"/>
<field name="phone_subsidy"/>
<field name="attendance_bonus"/>
<field name="all_wage"/>
<field name="yuthon_company" required="1"/>
<field name="create_time"/>
<field name="end_time"/>
</tree>
</field>
</record>
<record id="view_yuthon_job_lv_search" model="ir.ui.view">
<field name="name">yuthon.job.lv.search</field>
<field name="model">yuthon.job.lv</field>
<field name="arch" type="xml">
<search string="职级查询">
<group expand="0">
<filter name="group_date" string="查询年月" context="{'group_by': 'create_time'}"/>
<filter name="group_company" string="所属公司" context="{'group_by': 'yuthon_company'}"/>
<filter name="group_lv" string="级别" context="{'group_by': 'lv'}"/>
</group>
</search>
</field>
</record>
<!--天河投资 -->
<record id="view_yuthon_job_lv_action2" model="ir.actions.act_window">
<field name="name">天河投资职级</field>
<field name="res_model">yuthon.job.lv</field>
<field name="view_mode">tree</field>
<field name="domain">[('yuthon_company', '=', 'thtz')]</field>
<field name="context">{'search_default_group_lv': 1}</field>
</record>
<!--天河物管 -->
<record id="view_yuthon_job_lv_tree3" model="ir.ui.view">
<field name="name">yuthon.job.lv.tree</field>
<field name="model">yuthon.job.lv</field>
<field name="arch" type="xml">
<tree editable="bottom">
<field name="sequence"/>
<field name="lv"/>
<field name="name"/>
<field name="comprehensive_subsidy"/>
<field name="phone_subsidy"/>
<field name="attendance_bonus"/>
<field name="all_wage"/>
<field name="yuthon_company" required="1"/>
<field name="create_time"/>
<field name="end_time"/>
</tree>
</field>
</record>
<record id="view_yuthon_job_lv_action3" model="ir.actions.act_window">
<field name="name">天河物管职级</field>
<field name="res_model">yuthon.job.lv</field>
<field name="view_mode">tree</field>
<field name="domain">[('yuthon_company', '=', 'thwg')]</field>
<field name="context">{'search_default_group_lv': 1}</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_hr_employee.view_yuthon_job_lv_tree3')})]"/>
</record>
<record id="view_yuthon_job_lv_tree4" model="ir.ui.view">
<field name="name">yuthon.job.lv.tree</field>
<field name="model">yuthon.job.lv</field>
<field name="arch" type="xml">
<tree editable="bottom">
<field name="sequence"/>
<field name="lv"/>
<field name="name"/>
<field name="base_wage"/>
<field name="post_subsidy"/>
<field name="post_wage"/>
<field name="monthly_performance"/>
<field name="duty_pay"/>
<field name="assignment_subsidy"/>
<field name="temporary_performance"/>
<field name="all_wage"/>
<field name="yuthon_company" required="1"/>
<field name="create_time"/>
<field name="end_time"/>
</tree>
</field>
</record>
<record id="view_yuthon_job_lv_action4" model="ir.actions.act_window">
<field name="name">天河粮储职级</field>
<field name="res_model">yuthon.job.lv</field>
<field name="view_mode">tree</field>
<field name="domain">[('yuthon_company', '=', 'thlc')]</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_hr_employee.view_yuthon_job_lv_tree4')})]"/>
<field name="context">{'search_default_group_lv': 1}</field>
</record>
<!-- Menus -->
<menuitem
id="menu_yuthon_job_lv"
name="职级管理"
parent="hr.menu_config_employee"
sequence="6"/>
<menuitem
id="menu_yuthon_job_lv_all2"
name="天河投资职级"
parent="menu_yuthon_job_lv"
action="view_yuthon_job_lv_action2"
groups="group_party_topic_lv"
sequence="1"/>
<menuitem
id="menu_yuthon_job_lv_all3"
name="天河物管职级"
parent="menu_yuthon_job_lv"
action="view_yuthon_job_lv_action3"
groups="group_team_topic_lv"
sequence="3"/>
<menuitem
id="menu_yuthon_job_lv_all4"
name="天河粮储职级"
parent="menu_yuthon_job_lv"
action="view_yuthon_job_lv_action4"
groups="group_board_topic_lv"
sequence="5"/>
</odoo>
@@ -48,7 +48,6 @@ class HrJob(models.Model):
'hr_job_id':job.id,
'department_id': job.department_id.id,
'job_type_id': job.job_type_id.id,
'job_lv_id': job.job_lv_id.name,
'yuthon_company': job.yuthon_company,
'establishment_quotas': job.establishment_quotas,
'no_of_employee': job.no_of_employee,
@@ -14,10 +14,8 @@ class YuthonLeavingApproval(models.Model):
phone = fields.Char(related='users_id.employee_id.work_phone',string='手机号')
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="任职单位")
job_id = fields.Many2one(related='users_id.employee_id.job_id', string="主岗")
duties = fields.Char(string="职务")
job_lv_id = fields.Many2one(related='users_id.employee_id.job_lv_id', string='职级')
job_type_id = fields.Many2one('hr.job.type', string="岗位类别")
onboarding_date = fields.Date(related='users_id.employee_id.entry_date',string="入职日期")
end_of_contract = fields.Date(string="合同结束日期")
@@ -28,7 +28,6 @@ class YuthonOnboardApproval(models.Model):
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="甲方")
grades_id = fields.Many2one('yuthon.job.lv', string='职级')
account = fields.Char(string='账号')
bank = fields.Char(string='开户行')
onboarding_status = fields.Selection([('none', '待入职'), ('onboarding', '已入职')], string='审批后员工状态', default='none')
@@ -107,7 +106,6 @@ class YuthonOnboardApproval(models.Model):
'default_employee_id': employee.id,
'default_date_start': self.duration_employment,
'default_date_end': self.duration_employment_end,
'default_job_lv_id': self.grades_id.id,
}}
@api.onchange('employee_name')
def _onchange_employee_id(self):
@@ -30,7 +30,7 @@ class YuthonPrepareApproval(models.Model):
'yuthon_company': new.yuthon_company,
'job_type_id': new.job_type_id.id,
'compiling_external': new.compiling_external,
'job_lv_id': new.job_lv_id.id,
'establishment_quotas': new.establishment_quotas,
'no_of_employee': new.no_of_employee,
'missing_number': new.missing_number,
@@ -48,7 +48,6 @@ class YuthonPrepareApproval(models.Model):
'yuthon_company': prepare.yuthon_company,
'job_type_id': prepare.job_type_id.id,
'compiling_external': prepare.compiling_external,
'job_lv_id': prepare.job_lv_id.id,
'establishment_quotas': prepare.establishment_quotas,
'no_of_employee': prepare.no_of_employee,
'missing_number': prepare.missing_number,
@@ -85,7 +84,6 @@ class PrepareApprovalLine(models.Model):
('thlc', '天河粮储')], string="所属公司")
job_type_id = fields.Many2one('hr.job.type', string="岗位类型")
compiling_external = fields.Integer(string="编制外人数")
job_lv_id = fields.Many2one('yuthon.job.lv', string="职级")
establishment_quotas = fields.Integer(string="编制人数")
no_of_employee = fields.Integer(string="当前员工数量")
missing_number = fields.Integer(string="缺编人数", compute='_compute_missing_number')
@@ -142,7 +140,6 @@ class NewPrepareApprovalLine(models.Model):
('thlc', '天河粮储')], string="所属公司")
job_type_id = fields.Many2one('hr.job.type', string="岗位类型")
compiling_external = fields.Integer(string="编制外人数")
job_lv_id = fields.Many2one('yuthon.job.lv', string="职级")
establishment_quotas = fields.Integer(string="编制人数")
no_of_employee = fields.Integer(string="当前员工数量")
missing_number = fields.Integer(string="缺编人数",compute='_compute_missing_number')
@@ -16,7 +16,6 @@ class YuthonReassignmentApproval(models.Model):
('thlc', '天河粮储')], string="任职单位")
job_id = fields.Many2one(related='users_id.employee_id.job_id', string="主岗")
duties = fields.Char(string="职务")
job_lv_id = fields.Many2one(related='users_id.employee_id.job_lv_id', string='职级')
job_type_id = fields.Many2one('hr.job.type', string="岗位类别")
onboarding_date = fields.Date(string="任职日期")
end_of_contract = fields.Date(related='users_id.employee_id.entry_date',string="入职日期")
@@ -40,7 +39,6 @@ class YuthonReassignmentApproval(models.Model):
change_parent_id = fields.Many2one("hr.employee", string="直线上级")
change_business_superior_id = fields.Many2one("hr.employee", string="业务上级")
change_duties = fields.Char(string="职务")
change_job_lv = fields.Many2one('yuthon.job.lv', string='职级')
change_department_id = fields.Many2one("hr.department", string="任职部门")
change_job_type_id = fields.Many2one('hr.job.type', string="岗位类别")
change_job_id = fields.Many2one("hr.job", string="主岗")
@@ -17,7 +17,6 @@ class YuthonRegularizationPrepareApproval(models.Model):
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="任职单位")
job_type_id = fields.Many2one('hr.job.type', string="岗位类别")
job_lv_id = fields.Many2one(related='users_id.employee_id.job_lv_id', string='职级')
onboarding_time = fields.Date(related='users_id.employee_id.entry_date',string="入职日期")
trial_end_date = fields.Date(string="试用期结束日期")
parent_id = fields.Many2one(related='users_id.employee_id.parent_id',string="直线上级")
@@ -17,7 +17,6 @@ class YutransferApproval(models.Model):
('thlc', '天河粮储')], string="所属公司")
main_post = fields.Many2one("hr.job", string="主岗")
duties = fields.Char(string="职务")
grades = fields.Many2one('yuthon.job.lv', string='职级')
job_type_id = fields.Many2one('hr.job.type', string="岗位类别")
onboarding_date = fields.Date(string="入职日期")
end_of_contract = fields.Date(string="任现职日期")
@@ -41,7 +41,6 @@
</group>
<group>
<field name="duties"/>
<field name="job_lv_id"/>
<field name="business_superior"/>
</group>
</group>
@@ -46,7 +46,7 @@
<field name="documents_ids" widget="many2many_tags"/>
</group>
<group>
<field name="grades_id"/>
<field name="job_id"/>
<field name="social_security"/>
</group>
<group>
@@ -55,7 +55,6 @@
</group>
<group>
<field name="probation_period"/>
<field name="job_id"/>
</group>
</group>
<group>
@@ -44,7 +44,6 @@
<field name="prepare_approval_id" column_invisible="1"/>
<field name="department_id"/>
<field name="job_type_id"/>
<field name="job_lv_id"/>
<field name="yuthon_company"/>
<field name="establishment_quotas"/>
<field name="no_of_employee"/>
@@ -63,7 +62,6 @@
<field name="prepare_approval_id" column_invisible="1"/>
<field name="department_id"/>
<field name="job_type_id"/>
<field name="job_lv_id"/>
<field name="yuthon_company"/>
<field name="establishment_quotas"/>
<field name="no_of_employee"/>
@@ -37,7 +37,6 @@
</group>
<group>
<field name="job_id"/>
<field name="job_lv_id"/>
<field name="person_attributes"/>
<field name="phone"/>
</group>
@@ -65,7 +64,6 @@
</group>
<group>
<field name="change_duties"/>
<field name="change_job_lv"/>
<field name="change_place_of_work"/>
</group>
</group>
@@ -43,7 +43,6 @@
<field name="name"/>
<field name="department_id"/>
<field name="job_type_id"/>
<field name="job_lv_id"/>
<field name="yuthon_company"/>
<field name="establishment_quotas"/>
<field name="no_of_employee"/>
@@ -11,7 +11,6 @@
<field name="department_id"/>
<field name="job_id"/>
<field name="job_coach" string="导师"/>
<field name="job_lv_id"/>
<field name="regularization_rules"/>
<field name="approval_regularization"/>
<field name="regularization"/>
@@ -43,7 +42,6 @@
</group>
<group>
<field name="job"/>
<field name="job_lv_id"/>
</group>
</group>
<group string="转正考核" col="4">
@@ -34,12 +34,10 @@
</group>
<group>
<field name="main_post"/>
<field name="job_type_id"/>
<field name="straight_superiors"/>
</group>
<group>
<field name="duties"/>
<field name="grades"/>
<field name="business_superior"/>
</group>
</group>
@@ -7,15 +7,17 @@ class YuthonIndexEmployee(models.Model):
start_index_time = fields.Date(string='生效时间', required=True)
end_index_time = fields.Date(string='失效时间')
users_role_ids = fields.Many2many('soong.user.role', string='角色')
assessment_items = fields.Text(string='考核项目')
score_range_on = fields.Float(string='分值范围')
score_range_off = fields.Float(string='分值范围')
description_score = fields.Text(string='分值说明')
in_charge_role_id = fields.Many2one('soong.user.role', string='角色')
employee_ids = fields.Many2many('hr.employee', string='人员范围')
department_ids = fields.Many2many('hr.department', string='部门')
employee_ids = fields.Many2many('hr.employee', string='人员')
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
dimension = fields.Char('评价维度', required=True)
name = fields.Char('评价维度', required=True)
change_employee_library_id = fields.Many2one('yuthon.employee.approval', string='变更指标库')
index_employee_ids = fields.One2many('yuthon.index.employee.line', 'index_employee_id', string='指标库明细')
def put_employees_approval(self):
form_id = self.env.ref('yuthon_performance.yuthon_employee_approval_form').id
index_applicant_ids = self.env["yuthon.index.employee"].browse(
@@ -41,11 +43,4 @@ class YuthonIndexEmployee(models.Model):
"name":"员工详情",
"view_mode": "form",
}
class YuthonIndexEmployeeLine(models.Model):
_name = 'yuthon.index.employee.line'
_description = '员工绩效指标库明细'
index_employee_id = fields.Many2one('yuthon.index.employee', string="关联员工绩效标准库")
grading_criteria = fields.Char('评分标准')
grading_content = fields.Char('评分内容')
@@ -51,7 +51,6 @@
<!-- <field name="dimension"/>-->
<field name="change_employee_library_id" column_invisible="1"/>
<field name="department_ids" widget="many2many_tags"/>
<field name="users_role_ids" widget="many2many_tags"/>
<field name="employee_ids" widget="many2many_tags"/>
<field name="start_index_time"/>
<field name="end_index_time"/>
@@ -9,10 +9,11 @@
<button name="put_employees_approval" type="object" string="提交员工指标变更申请"/>
<button name="put_assessment_tasks1_approval" type="object" string="提交考核任务"/>
</header>
<field name="name"/>
<field name="assessment_items"/>
<field name="score_range_on"/>
<field name="description_score"/>
<field name="in_charge_role_id"/>
<field name="department_ids" widget="many2many_tags"/>
<field name="users_role_ids" widget="many2many_tags"/>
<field name="employee_ids" widget="many2many_tags"/>
<field name="start_index_time"/>
<field name="yuthon_company" optional="hide"/>
<field name="end_index_time"/>
@@ -27,30 +28,27 @@
<sheet>
<group col="3">
<group>
<field name="name"/>
<field name="assessment_items"/>
<field name="start_index_time"/>
<field name="yuthon_company"/>
</group>
<group>
<field name="employee_ids" widget="many2many_tags"/>
<field name="in_charge_role_id"/>
<field name="end_index_time"/>
<field name="description_score"/>
</group>
<group>
<field name="users_role_ids" widget="many2many_tags"/>
<field name="department_ids" widget="many2many_tags"/>
<field name="employee_ids" widget="many2many_tags"/>
</group>
</group>
<notebook>
<page string="评分详细">
<field name="index_employee_ids">
<tree editable="bottom">
<field name="index_employee_id" column_invisible="1"/>
<field name="grading_criteria"/>
<field name="grading_content"/>
</tree>
</field>
</page>
</notebook>
<group>
<label for="score_range_on"/>
<div>
<field name="score_range_on" class="oe_inline"/>~
<field name="score_range_off" class="oe_inline"/>
</div>
</group>
</sheet>
</form>
</field>
+10 -7
View File
@@ -69,7 +69,7 @@ class YuthonSalaryWizard(models.Model):
if not structure_id:
structure_id = self.env['hr.payroll.structure'].create({
'name': text,
'lv_id':struct_id.id,
'type_id':struct_id.id,
'sequence': row[0].value,
'yuthon_company': yuthon_company,})
yuthon_company = yuthon_company_dict.get(row[10].value)
@@ -94,20 +94,23 @@ class YuthonSalaryWizard(models.Model):
salary_name = self.env['hr.salary.rule']
job = row[1].value
text = row[2].value
yuthon_company = yuthon_company_dict.get(row[11].value)
struct_id = self.env['hr.payroll.structure.type'].search([('name', '=', job)])
company_code = yuthon_company_dict.get(row[11].value)
struct_id = self.env['hr.payroll.structure.type'].search([
('name', '=', job),
('yuthon_company', '=', company_code)
])
if not struct_id:
struct_id = self.env['hr.payroll.structure.type'].create({
'name': job,
'sequence': row[0].value,
'yuthon_company': yuthon_company})
'yuthon_company': company_code})
structure_id = self.env['hr.payroll.structure'].search([('name', '=', text)])
if not structure_id:
structure_id = self.env['hr.payroll.structure'].create({
'name': text,
'lv_id':struct_id.id,
'type_id':struct_id.id,
'sequence': row[0].value,
'yuthon_company': yuthon_company,})
'yuthon_company': company_code,})
yuthon_company = yuthon_company_dict.get(row[11].value)
yuthon_company2 = yuthon_company_dict2.get(row[11].value)
for salary, r in zip(salary_dates, row[3:11]):
@@ -141,7 +144,7 @@ class YuthonSalaryWizard(models.Model):
if not structure_id:
structure_id = self.env['hr.payroll.structure'].create({
'name': text,
'lv_id': struct_id.id,
'type_id': struct_id.id,
'sequence': row[0].value,
'yuthon_company': yuthon_company, })
yuthon_company = yuthon_company_dict.get(row[16].value)
-22
View File
@@ -112,28 +112,6 @@
parent="hr_employee_menu_root_board"
action="hr.open_view_employee_list_my"
sequence="1"/>
<menuitem id="hr_set_lv_menu_root_board"
name="职级管理"
parent="hr_employee_menu_root_board"
sequence="3"/>
<menuitem id="menu_yuthon_job_lv_all2_board"
name="天河投资职级"
parent="hr_set_lv_menu_root_board"
action="yuthon_hr_employee.view_yuthon_job_lv_action2"
groups="yuthon_hr_employee.group_party_topic_lv"
sequence="1"/>
<menuitem id="menu_yuthon_job_lv_all3_board"
name="天河物管职级"
parent="hr_set_lv_menu_root_board"
action="yuthon_hr_employee.view_yuthon_job_lv_action3"
groups="yuthon_hr_employee.group_team_topic_lv"
sequence="3"/>
<menuitem id="menu_yuthon_job_lv_all4_board"
name="天河粮储职级"
parent="hr_set_lv_menu_root_board"
action="yuthon_hr_employee.view_yuthon_job_lv_action4"
groups="yuthon_hr_employee.group_board_topic_lv"
sequence="5"/>
<menuitem id="hr_recruitment_work_job_menu_board"
name="岗位编制"
parent="hr_employee_menu_root_board"