diff --git a/yuthon_performance/__manifest__.py b/yuthon_performance/__manifest__.py index ae81ebd4b..d1e747add 100644 --- a/yuthon_performance/__manifest__.py +++ b/yuthon_performance/__manifest__.py @@ -10,11 +10,16 @@ 'category': 'Human Resources/Attendances', 'version': '0.1', 'license': 'LGPL-3', - 'depends': ['base'], + 'depends': ['hr','soong_workflow'], 'data': [ 'security/ir.model.access.csv', - 'views/yuthon_performance_views.xml', - 'views/yuthon_performance_manage_views.xml' + 'views/yuthon_Index_management.xml', + 'views/yuthon_duty_management.xml', + 'views/yuthon_performance_menus.xml', + 'views/yuthon_plan_management.xml', + 'views/yuthon_Index_approval.xml', + 'views/yuthon_duty_approval.xml', + 'views/yuthon_plan_approval.xml', ], 'installable': True, 'application': True, diff --git a/yuthon_performance/models/__init__.py b/yuthon_performance/models/__init__.py index c60cce89a..794acdad2 100644 --- a/yuthon_performance/models/__init__.py +++ b/yuthon_performance/models/__init__.py @@ -1,4 +1,8 @@ # -*- coding: utf-8 -*- -from . import yuthon_performance -from . import yuthon_performance_manage +from . import yuthon_Index_management +from . import yuthon_duty_management +from . import yuthon_plan_management +from . import yuthon_Index_approval +from . import yuthon_duty_approval +from . import yuthon_plan_approval diff --git a/yuthon_performance/models/yuthon_Index_approval.py b/yuthon_performance/models/yuthon_Index_approval.py new file mode 100644 index 000000000..353dbcce9 --- /dev/null +++ b/yuthon_performance/models/yuthon_Index_approval.py @@ -0,0 +1,12 @@ +from odoo import models, fields, api, exceptions, _ +class YuthonIndexApproval(models.Model): + _name = 'yuthon.index.approval' + _description = "指标库变更管理" + _rec_name = 'name' + + name = fields.Char('标题') + creation_time = fields.Datetime(string='申请日期', default=lambda self: fields.Datetime.now()) + job_id = fields.Many2one('hr.job', string="岗位") + reason_text = fields.Html(string='申请事由') + + change_index_library_ids = fields.One2many("yuthon.index.management",'change_index_library_id',string="指标库变更明细") diff --git a/yuthon_performance/models/yuthon_Index_management.py b/yuthon_performance/models/yuthon_Index_management.py new file mode 100644 index 000000000..1929a1e8f --- /dev/null +++ b/yuthon_performance/models/yuthon_Index_management.py @@ -0,0 +1,37 @@ + +from odoo import models, fields, api, exceptions, _ +class YuthonIndexManagement(models.Model): + _name = 'yuthon.index.management' + _description = "指标库" + + dimension = fields.Char('维度', required=True) + development_goals = fields.Char('发展目标', required=True) + index_name = fields.Char('指标名称', required=True) + index_definition = fields.Char('指标定义', required=True) + index_type = fields.Selection([('kpi', 'KPI'), + ('gs', 'GS'), + ('refused_index', '否决指标'),],'指标类别') + index_compute = fields.Char('指标计算公式', required=True) + compute_type = fields.Selection([('bad_index', '反向指标'), + ('good_index', '正向指标'), + ('two_index', '双向指标'),],'计算类别') + check_norm = fields.Char('考核标准', required=True) + department_ids = fields.Many2many("hr.department", string="指标来源", required=True) + in_charge_role = fields.Many2one('soong.user.role', string='角色') + employee_id = fields.Many2one('hr.employee', string="员工") + start_index_time = fields.Date(string='指标生效时间', required=True) + end_index_time = fields.Date(string='指标失效时间') + unit_compute = fields.Char('计算单位') + weight = fields.Char(string="权重%") + compute_method = fields.Char(string="计算方法") + compute_act = fields.Char(string="计划安排及具体措施/行动") + + change_index_library_id = fields.Many2one("yuthon.index.approval", string="指标库变更明细") + index_duty_id = fields.Many2one('yuthon.duty.management', string="绩效明细") + index_duty_approval_id = fields.Many2one('yuthon.duty.approval', string="部门责任变更明细") + + + + + + diff --git a/yuthon_performance/models/yuthon_duty_approval.py b/yuthon_performance/models/yuthon_duty_approval.py new file mode 100644 index 000000000..0a034731d --- /dev/null +++ b/yuthon_performance/models/yuthon_duty_approval.py @@ -0,0 +1,15 @@ +from odoo import models, fields, api, exceptions, _ +class YuthonDutyApproval(models.Model): + _name = 'yuthon.duty.approval' + _description = "部门责任书变更管理" + _rec_name = 'name' + + name = fields.Char('标题') + creation_time = fields.Datetime(string='申请日期', default=lambda self: fields.Datetime.now()) + job_id = fields.Many2one('hr.job', string="岗位") + reason_text = fields.Html(string='申请事由') + + # 指标变更 + # change_duty_kpi_ids = fields.One2many('yuthon.kpi.line', 'change_duty_kpi_id', string="KPI变更明细") + # change_duty_gs_ids = fields.One2many('yuthon.gs.line', 'change_duty_gs_id', string="GS变更明细") + index_duty_approval_ids = fields.One2many('yuthon.index.management', 'index_duty_approval_id', string="部门责任变更明细") diff --git a/yuthon_performance/models/yuthon_duty_management.py b/yuthon_performance/models/yuthon_duty_management.py new file mode 100644 index 000000000..551ed0ff1 --- /dev/null +++ b/yuthon_performance/models/yuthon_duty_management.py @@ -0,0 +1,89 @@ +from odoo import models, fields, api, exceptions, _ + + +class YuthonDutyManagement(models.Model): + _name = 'yuthon.duty.management' + _description = "部门责任书" + _rec_name = 'name' + + name = fields.Char('标题') + assessment_time = fields.Char('考核时间', required=True) + cycle = fields.Selection([('monthly', '月度'), + ('quarter', '季度'), + ('up_half', '上半年'), + ('down_half', '下半年'), + ('year', '年度'), ], '周期', required=True) + + department_id = fields.Many2one("hr.department", string="部门", required=True) + start_index_time = fields.Date('指标生效时间') + end_index_time = fields.Date('指标失效时间') + index_statu = fields.Selection([('work', '生效'), ('void', '作废')], '状态', required=True) + # 绩效考核 + # performance_kpi_ids = fields.One2many('yuthon.kpi.line', 'performance_kpi_id', string="KPI") + # performance_gs_ids = fields.One2many('yuthon.gs.line', 'performance_gs_id', string="GS") + + index_duty_ids = fields.One2many('yuthon.index.management', 'index_duty_id', string="绩效明细") + + @api.onchange('assessment_time', 'cycle', 'department_id') + def _onchange_year_department(self): + if self.cycle and self.department_id and self.assessment_time: + cycle_dict = {'monthly': '月度', 'quarter': '季度', 'up_half': '上半年', 'down_half': '下半年', + 'year': '年度'} + cycle_display = cycle_dict.get(self.cycle, self.cycle) + self.name = f"{self.assessment_time}{cycle_display}{self.department_id.name}责任书" + + +# class YuthonKpiLine(models.Model): +# _name = 'yuthon.kpi.line' +# _description = "KPI明细行" +# +# # 链接部门责任书和变更菜单 +# performance_kpi_id = fields.Many2one('yuthon.duty.management', string="KPI") +# change_duty_kpi_id = fields.Many2one('yuthon.duty.approval', string="KPI变更明细") +# + # KPI + # 指标名称 + # index_name_id = fields.Many2one('yuthon.index.management') + # duty_index_name = fields.Char(related='index_name_id.index_name', string='考核任务名称', store=True) + +# index_definition_id = fields.Many2one('yuthon.index.management') +# duty_index_definition = fields.Char(related='index_definition_id.index_definition', string="指标定义") +# +# index_id = fields.Many2one('yuthon.index.management') +# duty_index_type = fields.Selection(related='index_id.compute_type', string='计算类别', store=True) +# +# in_charge_role_id = fields.Many2one('yuthon.index.management') +# in_charge_role = fields.Many2one('soong.user.role', related='in_charge_role_id.in_charge_role', string='角色') +# +# duty_employee_id = fields.Many2one('yuthon.index.management') +# employee_id = fields.Many2one('hr.employee', related='duty_employee_id.employee_id', string="员工", store=True) +# +# unit_compute = fields.Char('计算单位') +# weight = fields.Char(string="权重%") +# compute_method = fields.Char(string="计算方法") +# +# +# class YuthonGsLine(models.Model): +# _name = 'yuthon.gs.line' +# _description = "GS明细行" +# +# # 链接部门责任书和变更菜单 +# performance_gs_id = fields.Many2one('yuthon.duty.management', string="GS") +# change_duty_gs_id = fields.Many2one('yuthon.duty.approval', string="GS变更明细") +# # index_duty_gs_id = fields.Many2one('yuthon.index.management', string="GS变更明细") +# # 指标名称 +# index_name_id = fields.Many2one('yuthon.index.management') +# work_task = fields.Char(related='index_name_id.index_name', string="工作任务") +# +# compute_act = fields.Char(string="计划安排及具体措施/行动") +# +# index_id = fields.Many2one('yuthon.index.management', string='Index') +# duty_index_type = fields.Selection(related='index_id.compute_type', string='计算类别', store=True) +# +# in_charge_role_id = fields.Many2one('yuthon.index.management') +# in_charge_role = fields.Many2one('soong.user.role', related='in_charge_role_id.in_charge_role', string='角色') +# +# duty_employee_id = fields.Many2one('yuthon.index.management') +# employee_id = fields.Many2one('hr.employee', string="员工", related='duty_employee_id.employee_id', store=True) +# +# weight = fields.Char(string="权重%") diff --git a/yuthon_performance/models/yuthon_performance.py b/yuthon_performance/models/yuthon_performance.py deleted file mode 100644 index e1c38627f..000000000 --- a/yuthon_performance/models/yuthon_performance.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import models, fields, api, exceptions, _ - - -class YuthonPerformace(models.Model): - _name = 'yuthon.performance' - _description = "员工绩效" - - name = fields.Char(string="绩效名称") - performance_type = fields.Char(string="指标来源") - performance_ids = fields.One2many('yuthon.performance.line', 'performance_id', string="绩效类型") - - -class YuthonPerformaceLine(models.Model): - _name = 'yuthon.performance.line' - _description = "员工绩效明细" - - performance_id = fields.Many2one('yuthon.performance', string="绩效") - metric_type = fields.Char(string="指标类型") - metric_name = fields.Char(string="指标名称") - metric_define = fields.Char(string="指标定义") - work_task = fields.Char(string="工作任务") - weight = fields.Char(string="权重%") - compute_method = fields.Char(string="计算方法") - compute_uom = fields.Char(string="计算单位") - compute_act = fields.Char(string="计划安排及具体措施/行动") - # 上半年 - half_t1 = fields.Integer(string="底线值T1") - half_t2 = fields.Integer(string="基准值T2") - half_t3 = fields.Integer(string="努力值T3") - half_node = fields.Date(string="节点目标") - half_quality = fields.Char(string="质量目标") - # 下半年 - later_t1 = fields.Integer(string="底线值T1") - later_t2 = fields.Integer(string="基准值T2") - later_t3 = fields.Integer(string="努力值T3") - later_node = fields.Date(string="节点目标") - later_quality = fields.Char(string="质量目标") - # 年度 - annual_t1 = fields.Integer(string="底线值T1") - annual_t2 = fields.Integer(string="基准值T2") - annual_t3 = fields.Integer(string="努力值T3") - annual_node = fields.Date(string="节点目标") - annual_quality = fields.Char(string="质量目标") - diff --git a/yuthon_performance/models/yuthon_performance_manage.py b/yuthon_performance/models/yuthon_performance_manage.py deleted file mode 100644 index de6c5800f..000000000 --- a/yuthon_performance/models/yuthon_performance_manage.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from odoo import models, fields, api, exceptions, _ - - -class YuthonPerformaceManage(models.Model): - _name = 'yuthon.performance.manage' - _description = "管理" -#员工,时间,指标名称,指标类型,指标来源,绩效数值 - employee_id = fields.Many2one('hr.employee', string="员工") - create_time = fields.Datetime(string="创建时间") - metric_name = fields.Char(string="指标名称") - metric_type = fields.Char(string="指标类型") - performance_type = fields.Char(string="指标来源") - Performance_numbers = fields.Float(string="绩效分值") - - - diff --git a/yuthon_performance/models/yuthon_plan_approval.py b/yuthon_performance/models/yuthon_plan_approval.py new file mode 100644 index 000000000..f21201512 --- /dev/null +++ b/yuthon_performance/models/yuthon_plan_approval.py @@ -0,0 +1,12 @@ +from odoo import models, fields, api, exceptions, _ +class YuthonPlanApproval(models.Model): + _name = 'yuthon.plan.approval' + _description = "个人计划变更管理" + _rec_name = 'name' + + name = fields.Char('标题') + creation_time = fields.Datetime(string='申请日期', default=lambda self: fields.Datetime.now()) + job_id = fields.Many2one('hr.job', string="岗位") + reason_text = fields.Html(string='申请事由') + + change_plan_ids = fields.One2many("yuthon.plan.management.line",'change_plan_id',string="个人计划变更明细") diff --git a/yuthon_performance/models/yuthon_plan_management.py b/yuthon_performance/models/yuthon_plan_management.py new file mode 100644 index 000000000..32cde3713 --- /dev/null +++ b/yuthon_performance/models/yuthon_plan_management.py @@ -0,0 +1,31 @@ + +from odoo import models, fields, api, exceptions, _ +class YuthonPlanManagement(models.Model): + _name = 'yuthon.plan.management' + _description = "计划管理" + _rec_name = 'name' + + name = fields.Char('标题') + creation_time = fields.Datetime(string='填报日期', default=lambda self: fields.Datetime.now()) + job_id = fields.Many2one('hr.job', string="岗位") + employee_id = fields.Many2one('hr.employee', string="员工") + department_id = fields.Many2one('hr.department', string="部门") + plan_ids = fields.One2many('yuthon.plan.management.line','plan_id' ,'计划明细') + +class YuthonPlanManagementLine(models.Model): + _name = 'yuthon.plan.management.line' + _description = "计划管理明细" + + plan_id = fields.Many2one('yuthon.plan.management','计划明细') + change_plan_id = fields.Many2one('yuthon.plan.approval','个人计划变更明细') + + index_name = fields.Char('工作任务名称') + index_plan = fields.Char('计划安排及具体措施/行动') + index_type = fields.Selection([('kpi', 'KPI'), + ('gs', 'GS'), + ('refused_index', '否决指标'),],'指标类别') + expected_goals = fields.Char('预期目标') + resource_requirements = fields.Char('资源要求') + completion_summary = fields.Char('完成情况总结') + + diff --git a/yuthon_performance/security/ir.model.access.csv b/yuthon_performance/security/ir.model.access.csv index 5b94b1b8e..d04327664 100644 --- a/yuthon_performance/security/ir.model.access.csv +++ b/yuthon_performance/security/ir.model.access.csv @@ -1,6 +1,10 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_yuthon_performance,yuthon_performance,model_yuthon_performance,base.group_user,1,1,1,1 -access_yuthon_performance_line,yuthon_performance_line,model_yuthon_performance_line,base.group_user,1,1,1,1 -access_yuthon_performance_manage,yuthon_performance_manage,model_yuthon_performance_manage,base.group_user,1,1,1,1 +access_yuthon_index_management,yuthon_index_management,model_yuthon_index_management,base.group_user,1,1,1,1 +access_yuthon_duty_management,yuthon_duty_management,model_yuthon_duty_management,base.group_user,1,1,1,1 +access_yuthon_plan_management,yuthon_plan_management,model_yuthon_plan_management,base.group_user,1,1,1,1 +access_yuthon_plan_management_line,yuthon_plan_management_line,model_yuthon_plan_management_line,base.group_user,1,1,1,1 +access_yuthon_index_approval,yuthon_index_approval,model_yuthon_index_approval,base.group_user,1,1,1,1 +access_yuthon_duty_approval,yuthon_duty_approval,model_yuthon_duty_approval,base.group_user,1,1,1,1 +access_yuthon_plan_approval,yuthon_plan_approval,model_yuthon_plan_approval,base.group_user,1,1,1,1 diff --git a/yuthon_performance/views/yuthon_Index_approval.xml b/yuthon_performance/views/yuthon_Index_approval.xml new file mode 100644 index 000000000..09c80ed7b --- /dev/null +++ b/yuthon_performance/views/yuthon_Index_approval.xml @@ -0,0 +1,78 @@ + + + + + yuthon.index.approval.tree + yuthon.index.approval + + + + + + + + + + yuthon.index.approval.form + yuthon.index.approval + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + yuthon.index.approval.search + yuthon.index.approval + + + + + + + + + 指标库变更 + yuthon.index.approval + tree,form + + +
\ No newline at end of file diff --git a/yuthon_performance/views/yuthon_Index_management.xml b/yuthon_performance/views/yuthon_Index_management.xml new file mode 100644 index 000000000..9918c20a8 --- /dev/null +++ b/yuthon_performance/views/yuthon_Index_management.xml @@ -0,0 +1,32 @@ + + + + + yuthon.index.management.tree + yuthon.index.management + + + + + + + + + + + + + + + + + + + + + 指标库 + yuthon.index.management + tree + + + \ No newline at end of file diff --git a/yuthon_performance/views/yuthon_duty_approval.xml b/yuthon_performance/views/yuthon_duty_approval.xml new file mode 100644 index 000000000..9a9bc940f --- /dev/null +++ b/yuthon_performance/views/yuthon_duty_approval.xml @@ -0,0 +1,91 @@ + + + + + yuthon.duty.approval.tree + yuthon.duty.approval + + + + + + + + + + yuthon.duty.approval.form + yuthon.duty.approval + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + yuthon.duty.approval.search + yuthon.duty.approval + + + + + + + + + 部门责任变更 + yuthon.duty.approval + tree,form + + +
\ No newline at end of file diff --git a/yuthon_performance/views/yuthon_duty_management.xml b/yuthon_performance/views/yuthon_duty_management.xml new file mode 100644 index 000000000..a68a5ae59 --- /dev/null +++ b/yuthon_performance/views/yuthon_duty_management.xml @@ -0,0 +1,86 @@ + + + + yuthon.duty.management.tree + yuthon.duty.management + + + + + + + + + + + + + yuthon.duty.management.form + yuthon.duty.management + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + + 部门责任书 + yuthon.duty.management + tree,form + +
diff --git a/yuthon_performance/views/yuthon_performance_manage_views.xml b/yuthon_performance/views/yuthon_performance_manage_views.xml deleted file mode 100644 index 81662371c..000000000 --- a/yuthon_performance/views/yuthon_performance_manage_views.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - yuthon.performance.manage.tree - yuthon.performance.manage - - - - - - - - - - - - - - 管理 - yuthon.performance.manage - tree,form - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/yuthon_performance/views/yuthon_performance_menus.xml b/yuthon_performance/views/yuthon_performance_menus.xml new file mode 100644 index 000000000..09566a447 --- /dev/null +++ b/yuthon_performance/views/yuthon_performance_menus.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/yuthon_performance/views/yuthon_performance_views.xml b/yuthon_performance/views/yuthon_performance_views.xml deleted file mode 100644 index 2e5532585..000000000 --- a/yuthon_performance/views/yuthon_performance_views.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - yuthon.performance.tree - yuthon.performance - - - - - - - - - yuthon.performance.form - yuthon.performance - -
- - - - - - - - - - - - - - - - - - - - - - - - # 上半年 - half_t1 = fields.Integer(string="底线值T1") - half_t2 = fields.Integer(string="基准值T2") - half_t3 = fields.Integer(string="努力值T3") - half_node = fields.Date(string="节点目标") - half_quality = fields.Char(string="质量目标") - # 下半年 - later_t1 = fields.Integer(string="底线值T1") - later_t2 = fields.Integer(string="基准值T2") - later_t3 = fields.Integer(string="努力值T3") - later_node = fields.Date(string="节点目标") - later_quality = fields.Char(string="质量目标") - # 年度 - annual_t1 = fields.Integer(string="底线值T1") - annual_t2 = fields.Integer(string="基准值T2") - annual_t3 = fields.Integer(string="努力值T3") - annual_node = fields.Date(string="节点目标") - annual_quality = fields.Char(string="质量目标") - - - performance_id = fields.Many2one('yuthon.performance', string="绩效") - metric_type = fields.Char(string="指标类型") - metric_name = fields.Char(string="指标名称") - metric_define = fields.Char(string="指标定义") - work_task = fields.Char(string="工作任务") - weight = fields.Char(string="权重%") - compute_method = fields.Char(string="计算方法") - compute_uom = fields.Char(string="计算单位") - compute_act = fields.Char(string="计划安排及具体措施/行动") - - - - - - - - - - - - - - - - -
- -
-
- - - 员工绩效配置 - yuthon.performance - tree,form - - - - - -
\ No newline at end of file diff --git a/yuthon_performance/views/yuthon_plan_approval.xml b/yuthon_performance/views/yuthon_plan_approval.xml new file mode 100644 index 000000000..80a6a9766 --- /dev/null +++ b/yuthon_performance/views/yuthon_plan_approval.xml @@ -0,0 +1,72 @@ + + + + + yuthon.plan.approval.tree + yuthon.plan.approval + + + + + + + + + + yuthon.plan.approval.form + yuthon.plan.approval + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + yuthon.plan.approval.search + yuthon.plan.approval + + + + + + + + + 个人计划变更 + yuthon.plan.approval + tree,form + + +
\ No newline at end of file diff --git a/yuthon_performance/views/yuthon_plan_management.xml b/yuthon_performance/views/yuthon_plan_management.xml new file mode 100644 index 000000000..3ad7ca190 --- /dev/null +++ b/yuthon_performance/views/yuthon_plan_management.xml @@ -0,0 +1,80 @@ + + + + yuthon.plan.management.tree + yuthon.plan.management + + + + + + + + + + + + + yuthon.plan.management.form + yuthon.plan.management + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + yuthon.plan.management.search + yuthon.plan.management + + + + + + + + + + + + + 计划管理 + yuthon.plan.management + tree,form + + + +