From 1b086a94f3f7c64ede27e0c2f40ce432324a4f9d Mon Sep 17 00:00:00 2001
From: zhouzhou <123@qq.com>
Date: Sun, 20 Oct 2024 21:23:34 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
yuthon_holiday/models/yuthon_holiday_type.py | 1 -
yuthon_holiday/views/yuthon_holiday_type.xml | 2 +-
.../models/holidays_approval.py | 24 +++-
.../views/holidays_approval.xml | 12 +-
yuthon_issue/models/inherit_room_booking.py | 22 +---
yuthon_issue/models/issue_approval.py | 117 +++++-------------
yuthon_issue/models/issue_library.py | 71 +++++++----
yuthon_issue/security/ir.model.access.csv | 2 +-
yuthon_issue/static/xml/issue_approval.xml | 47 -------
.../issue_approval_decision_type_views.xml | 2 +-
yuthon_issue/views/issue_approval_views.xml | 49 ++------
yuthon_issue/views/issue_library_views.xml | 14 ++-
.../models/yuthon_Index_management.py | 4 +-
.../models/yuthon_assessment_tasks.py | 19 +++
.../models/yuthon_duty_management.py | 2 +-
.../models/yuthon_employee_appraisal.py | 2 +-
.../models/yuthon_employee_performance.py | 14 ++-
.../models/yuthon_grading_tasks.py | 8 +-
.../models/yuthon_index_employee.py | 26 ++--
yuthon_performance/models/yuthon_kpi_tasks.py | 4 +-
.../security/ir.model.access.csv | 3 +-
.../views/yuthon_Index_approval.xml | 4 +-
.../views/yuthon_Index_management.xml | 4 +-
.../views/yuthon_assessment_tasks.xml | 6 +-
.../views/yuthon_duty_approval.xml | 4 +-
.../views/yuthon_employee_approval.xml | 5 +-
.../views/yuthon_employee_performance.xml | 2 +-
.../views/yuthon_grading_tasks.xml | 2 +-
.../views/yuthon_index_employee.xml | 44 +++----
yuthon_performance/views/yuthon_kpi_tasks.xml | 2 +-
.../yuthon_assessment_tasks_wizard_views.xml | 2 +-
31 files changed, 218 insertions(+), 302 deletions(-)
diff --git a/yuthon_holiday/models/yuthon_holiday_type.py b/yuthon_holiday/models/yuthon_holiday_type.py
index 811b24f42..025fb3f97 100644
--- a/yuthon_holiday/models/yuthon_holiday_type.py
+++ b/yuthon_holiday/models/yuthon_holiday_type.py
@@ -13,7 +13,6 @@ class HrLeaveType(models.Model):
travel_leave = fields.Char(string='路程假')
treated = fields.Text(string='待遇')
remarks = fields.Text(string="备注")
- # details_id = fields.Many2one('holiday.details.wizard', string='假期详情')
diff --git a/yuthon_holiday/views/yuthon_holiday_type.xml b/yuthon_holiday/views/yuthon_holiday_type.xml
index d16443f00..0ec7001a3 100644
--- a/yuthon_holiday/views/yuthon_holiday_type.xml
+++ b/yuthon_holiday/views/yuthon_holiday_type.xml
@@ -11,7 +11,7 @@
假期类型
-
+
diff --git a/yuthon_hr_attendance/models/holidays_approval.py b/yuthon_hr_attendance/models/holidays_approval.py
index 35696db3e..ceefd43bc 100644
--- a/yuthon_hr_attendance/models/holidays_approval.py
+++ b/yuthon_hr_attendance/models/holidays_approval.py
@@ -11,12 +11,11 @@ class HolidaysApprovals(models.Model):
_description = "请假审批"
# _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
- _rec_name = 'name'
+ name = fields.Char(string="名称")
company_page = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '天河粮储')], string="公司")
applicant_id = fields.Many2one('hr.employee', string="申请人", default=lambda self: self.env.user.id)
leave_absence_id = fields.Many2one('hr.employee', string="请假人")
- name = fields.Char(string="名称")
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('holidays_approval'))
department_id = fields.Many2one('hr.department', string="部门")
approvals_ids = fields.One2many('holidays.approvals.line', 'approvals_id', string="请假审批行")
@@ -33,6 +32,7 @@ class HolidaysApprovalsLine(models.Model):
_name = 'holidays.approvals.line'
_description = '请假审批行'
+ name = fields.Char(string="请假事由")
approvals_id = fields.Many2one('holidays.approval', string="管理请假审批")
vacation_category = fields.Many2one('holiday.type.setting', string="休假类别")
leave_type_id = fields.Many2one('hr.leave.type', string="请假类型",
@@ -42,8 +42,8 @@ class HolidaysApprovalsLine(models.Model):
store=True)
date_start = fields.Datetime(string="开始时间", default=fields.Datetime.now)
date_end = fields.Datetime(string="结束时间")
- leave_days = fields.Float(string='请假天数', store=True)
- surplus_days = fields.Float(string="剩余天数")
+ leave_days = fields.Float(string='请假天数', store=True,compute='_compute_leave_days')
+ surplus_days = fields.Float(string="剩余天数",compute='_compute_surplus_days')
@api.onchange('leave_type_id')
def onchange_approvals_ids(self):
@@ -51,6 +51,22 @@ class HolidaysApprovalsLine(models.Model):
rec.days_available = rec.leave_type_id.holiday_days
rec.applicants = rec.leave_type_id.request_unit
+ @api.depends('date_start', 'date_end')
+ def _compute_leave_days(self):
+ for rec in self:
+ if rec.date_start and rec.date_end:
+ delta = rec.date_end - rec.date_start
+ rec.leave_days = delta.days + (delta.seconds / 86400)
+ if rec.applicants == 'hour':
+ rec.leave_days = rec.leave_days / 24
+ else:
+ rec.leave_days = 0
+
+ @api.depends('leave_days', 'days_available')
+ def _compute_surplus_days(self):
+ for rec in self:
+ rec.surplus_days = rec.days_available - rec.leave_days
+
def button_holiday_detail(self):
return {
'name': '请假详情',
diff --git a/yuthon_hr_attendance/views/holidays_approval.xml b/yuthon_hr_attendance/views/holidays_approval.xml
index 36286b687..c3e62f4ad 100644
--- a/yuthon_hr_attendance/views/holidays_approval.xml
+++ b/yuthon_hr_attendance/views/holidays_approval.xml
@@ -6,7 +6,6 @@
holidays.approval
-
@@ -23,12 +22,6 @@
-
-
-
-
-
-
@@ -51,10 +44,11 @@
-
-
+
+
+
diff --git a/yuthon_issue/models/inherit_room_booking.py b/yuthon_issue/models/inherit_room_booking.py
index c1a9c45e1..6d371d6c4 100644
--- a/yuthon_issue/models/inherit_room_booking.py
+++ b/yuthon_issue/models/inherit_room_booking.py
@@ -6,25 +6,5 @@ class RoomBooking(models.Model):
room_booking_library_ids = fields.One2many('issue.library', 'room_booking_id')
decision_results = fields.Selection([('agree', '通过'), ('disagree', '未通过')], string="决策结果")
- issue_approval_line_id = fields.Many2one('issue.approval.room.line', string="关联会议详情明细行")
- @api.model_create_multi
- def create(self, vals_list):
- records = super(RoomBooking, self).create(vals_list)
- for vals in vals_list:
- if vals['room_booking_library_ids']:
- for library_id in vals['room_booking_library_ids']:
- issue_library_id = self.env['issue.library'].search([('id', '=', library_id[1])])
- issue_approval_id = issue_library_id.issue_approval_id.id
- self.env['issue.approval.room.line'].create({
- 'room_booking_id': records.id,
- 'room_approval_id': issue_approval_id,
- 'room_id': vals['room_id'],
- 'meeting_type_id': vals['meeting_type_id'],
- 'department_ids': vals['department_ids'],
- 'employee_ids': vals['employee_ids'],
- 'users_role_ids': vals['users_role_ids'],
- 'date_start': vals['start_datetime'],
- 'date_end': vals['stop_datetime'],
- })
- return records
\ No newline at end of file
+
diff --git a/yuthon_issue/models/issue_approval.py b/yuthon_issue/models/issue_approval.py
index f1af4f1ae..c634f4f15 100644
--- a/yuthon_issue/models/issue_approval.py
+++ b/yuthon_issue/models/issue_approval.py
@@ -23,103 +23,18 @@ class IssueApproval(models.Model):
is_attend = fields.Boolean(string="是否上会", default=True)
issue_text = fields.Html(string="正文")
notice_documents_ids = fields.Many2many('ir.attachment', string='议题附件')
- approval_decision_id = fields.Many2one('issue.approval.decision', string="关联决策清单")
-
- issue_library_ids = fields.One2many('issue.library', 'issue_approval_id', string="关联议题", store=True)
- approval_decision_ids = fields.One2many('issue.approval.decision', 'issue_approval_id', string="决策清单", store=True)
- room_approval_ids = fields.One2many('issue.approval.room.line', 'room_approval_id', string="会议详情明细行", store=True)
+ issue_approval_ids = fields.One2many('issue.approval.line', 'issue_approval_id', string="关联议题", store=True)
issue_data = fields.Char(string="议题事项js")
decision_data = fields.Char(string="决策清单js")
- meeting_data = fields.Char(string="会议详情js")
issue_display = fields.Char(string="议题事项", default='{"template": "yuthon_issue.html_issue_demo"}')
decision_display = fields.Char(string="决策清单", default='{"template": "yuthon_issue.html_decision_demo"}')
- meeting_display = fields.Char(string="会议详情", default='{"template": "yuthon_issue.table_meet_demo"}')
-
- is_parent_unit = fields.Boolean(string="上级单位", compute="_compute_is_parent_unit")
-
- @api.depends('issue_library_ids')
- def _compute_is_parent_unit(self):
- for line in self:
- line.is_parent_unit = bool(line.issue_library_ids.filtered('is_note'))
-
- @api.onchange('issue_library_ids')
- def _onchange_issue_data(self):
- self.issue_data = ''
- names = []
- if self.issue_library_ids:
- for record in self.issue_library_ids:
- names += [item.name for item in record]
- self.issue_data += ';'.join(names)
-
- @api.onchange('approval_decision_ids')
- def _onchange_decision_data(self):
- self.decision_data = ''
- names = []
- if self.approval_decision_ids:
- for record in self.approval_decision_ids:
- names += [item.specifics for item in record]
- self.decision_data += ';'.join(names)
-
-
- @api.onchange('room_approval_ids')
- def _onchange_meeting_data(self):
- meet_str = ''
- if self.room_approval_ids:
- for record in self.room_approval_ids:
- record_list = []
- record_list.append(record.meeting_type_id.name)
- record_list.append(record.date_start.strftime('%Y%m%d'))
- record_list.append(record.room_booking_id.name)
- record_list.append(dict(record._fields['decision_results'].selection).get(record.decision_results) if record.decision_results else ' ')
- meet_str = meet_str + '、'.join(record_list) + ';'
- self.meeting_data = meet_str
- else:
- self.meeting_data = ''
-
- @api.model_create_multi
- def create(self, vals_list):
- for vals in vals_list:
- for library_id in vals['issue_library_ids']:
- issue_id = self.env['issue.library'].search([('id', '=', library_id[1])])
- issue_id.write({'issue_approval_id': issue_id.id})
- return super().create(vals_list)
+ is_parent_unit = fields.Boolean(string="上级单位")
def pub_meeting_minutes(self):
pass
- def all_meeting_issue(self):
- form_id = self.env.ref("room.room_booking_view_form").id
- return {
- "type": "ir.actions.act_window",
- "name": "会议安排",
- "res_model": "room.booking",
- "views": [[form_id, "form"]],
- "context": {
- 'default_room_booking_library_ids': [(6, 0, self.issue_library_ids.ids)],
- }
- }
-
-class IssueApprovalRoomLine(models.Model):
- _name = 'issue.approval.room.line'
- _description = '会议详情明细行'
-
-
- room_booking_id = fields.Many2one('room.booking', string='会议名称')
- room_approval_id = fields.Many2one('issue.approval', string="关联议题审批")
- meeting_type_id = fields.Many2one('room.meeting.type', string="会议类型")
- room_id = fields.Many2one("room.room", string="会议地点")
- date_start = fields.Date(string="开始时间")
- date_end = fields.Date(string="结束时间")
- decision_results = fields.Selection([('agree', '通过'), ('disagree', '未通过')], string="决策结果")
-
- # 为room_users_ids 传值
- department_ids = fields.Many2many('hr.department', string='部门范围')
- employee_ids = fields.Many2many('hr.employee', string='人员范围')
- users_role_ids = fields.Many2many('soong.user.role', string='角色范围')
- room_users_ids = fields.Many2many('res.users', string="会议参加人员", compute="compute_room_users_ids", store=True)
-
@api.depends('department_ids', 'employee_ids', 'users_role_ids')
def compute_room_users_ids(self):
department_users_list = users_role_list = []
@@ -143,5 +58,33 @@ class IssueApprovalRoomLine(models.Model):
publish_user_list = department_users_list + employee_users_list + users_role_list
false_none_list = [x for x in publish_user_list if x != False]
users.room_users_ids = [(6, 0, list(set(false_none_list)))]
+
def bottom_meeting_minutes(self):
pass
+
+ @api.onchange('issue_approval_ids')
+ def onchange_name(self):
+ specifics_list = []
+ if self.issue_approval_ids:
+ for issue in self.issue_approval_ids:
+ if issue.issue_library_id.name:
+ specifics_list.append(issue.issue_library_id.name)
+ self.name = ';'.join(specifics_list) if specifics_list else ''
+
+
+
+
+class IssueApprovalLine(models.Model):
+ _name = 'issue.approval.line'
+ _description = '关联议题明细'
+
+ issue_approval_id = fields.Many2one('issue.approval', string='议题审批')
+
+ issue_library_id = fields.Many2one('issue.library',string='议题事项')
+ approval_decision_sequence = fields.Char(string='决策清单')
+ is_party = fields.Boolean(string="党之委会", default=False)
+ is_class = fields.Boolean(string="班子会", default=False)
+ is_boss = fields.Boolean(string="董事会", default=False)
+ is_note = fields.Boolean(string="上级单位", default=False)
+
+
diff --git a/yuthon_issue/models/issue_library.py b/yuthon_issue/models/issue_library.py
index e9161e539..3a432e0db 100644
--- a/yuthon_issue/models/issue_library.py
+++ b/yuthon_issue/models/issue_library.py
@@ -27,26 +27,16 @@ class IssueLibrary(models.Model):
issue_library_approval_line_ids = fields.One2many('issue.library.approval.line', 'issue_approval_id', string='流程记录')
room_booking_id = fields.Many2one('room.booking', string="会议室")
# ☑
+ approval_decision_sequence = fields.Char(string="决策清单事项")
- def issue_pull(self):
- for record in self:
- if record.state in ['approval', 'cancel']:
- raise UserError("当前状态不允许提交")
- form_id = self.env.ref("yuthon_issue.issue_library_approval_form").id
- approval_decision_ids = [i.issue_approval_decision_id.id for i in self.issue_library_line_ids]
- self.write({"state": "approval"})
- return {
- "type": "ir.actions.act_window",
- "name": "提交",
- "res_model": "issue.approval",
- "views": [[form_id, "form"]],
- "context": {
- 'default_issue_library_ids': [(6, 0, self.ids)],
- 'default_approval_decision_ids': [(6, 0, approval_decision_ids)],
- }}
-
- def issue_cancel(self):
- self.write({"state": "cancel"})
+ @api.onchange('issue_library_line_ids')
+ def onchange_approval_decision_sequence(self):
+ for dec in self:
+ specifics_list = []
+ for line in dec.issue_library_line_ids:
+ if line.issue_approval_decision_id:
+ specifics_list.append(line.issue_approval_decision_id.specifics)
+ dec.approval_decision_sequence = ';'.join(specifics_list) if specifics_list else ''
def all_issue_pull(self):
for record in self:
@@ -54,19 +44,48 @@ class IssueLibrary(models.Model):
raise UserError("当前状态不允许提交")
issue_active_ids = self.env["issue.library"].browse(self._context.get('active_ids', self._context.get('active_id')))
form_id = self.env.ref("yuthon_issue.issue_library_approval_form").id
- self.write({"state": "approval"})
- approval_decision_ids = []
- for i in issue_active_ids:
- for j in i.issue_library_line_ids:
- approval_decision_ids.append(j.issue_approval_decision_id.id)
+ issue_decision_lines = []
+ if not issue_active_ids:
+ issue_active_ids = self
+ for issue_record in issue_active_ids:
+ issue_record.write({"state": "approval"})
+ issue_decision_lines.append((0, 0, {
+ 'issue_approval_id': issue_record.id,
+ 'approval_decision_sequence': issue_record.approval_decision_sequence,
+ 'is_party':issue_record.is_party,
+ 'is_class': issue_record.is_class,
+ 'is_boss': issue_record.is_boss,
+ 'is_note': issue_record.is_note
+ }))
return {
"type": "ir.actions.act_window",
"name": "批量提交",
"res_model": "issue.approval",
"views": [[form_id, "form"]],
"context": {
- 'default_issue_library_ids': [(6, 0, issue_active_ids.ids)],
- 'default_approval_decision_ids': [(6, 0, approval_decision_ids)],
+ "default_issue_approval_ids": issue_decision_lines,
+ }
+ }
+
+ def issue_cancel(self):
+ self.write({"state": "cancel"})
+
+ def all_meeting_issue(self):
+ for meet in self:
+ if meet.state == 'on_meet':
+ raise UserError('不可重复上会')
+ meet.write({"state": "on_meet"})
+ issue_active_ids = self.env["issue.library"].browse(
+ self._context.get('active_ids', self._context.get('active_id')))
+ form_id = self.env.ref("room.room_booking_view_form").id
+ return {
+ "type": "ir.actions.act_window",
+ "name": "批量上会",
+ "res_model": "room.booking",
+ "views": [[form_id, "form"]],
+ "context": {
+ 'default_name': '',
+ 'default_room_booking_library_ids': [(6, 0, issue_active_ids.ids)],
}
}
diff --git a/yuthon_issue/security/ir.model.access.csv b/yuthon_issue/security/ir.model.access.csv
index 02934bf9c..db3a519bf 100644
--- a/yuthon_issue/security/ir.model.access.csv
+++ b/yuthon_issue/security/ir.model.access.csv
@@ -5,4 +5,4 @@ access_issue_approval_decision,issue_approval_decision,model_issue_approval_deci
access_issue_approval_decision_type,issue_approval_decision_type,model_issue_approval_decision_type,base.group_user,1,1,1,1
access_issue_library_approval_line,issue_library_approval_line,model_issue_library_approval_line,base.group_user,1,1,1,1
access_issue_approval,issue_approval,model_issue_approval,base.group_user,1,1,1,1
-access_issue_approval_room_line,issue_approval_room_line,model_issue_approval_room_line,base.group_user,1,1,1,1
+access_issue_approval_line,issue_approval_line,model_issue_approval_line,base.group_user,1,1,1,1
\ No newline at end of file
diff --git a/yuthon_issue/static/xml/issue_approval.xml b/yuthon_issue/static/xml/issue_approval.xml
index f245ea963..46ab2a6d2 100644
--- a/yuthon_issue/static/xml/issue_approval.xml
+++ b/yuthon_issue/static/xml/issue_approval.xml
@@ -23,51 +23,4 @@
-
-
-
-
-
-
- | 会议类型 |
- 会议时间 |
- 会议名称 |
-
- 决策结果 |
-
-
-
-
-
-
-
-
-
- ☑ |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- | ☑ |
- 上级单位 |
- |
- |
- |
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/yuthon_issue/views/issue_approval_decision_type_views.xml b/yuthon_issue/views/issue_approval_decision_type_views.xml
index 0abfaf02a..b9955d23b 100644
--- a/yuthon_issue/views/issue_approval_decision_type_views.xml
+++ b/yuthon_issue/views/issue_approval_decision_type_views.xml
@@ -27,8 +27,8 @@
-
+
diff --git a/yuthon_issue/views/issue_approval_views.xml b/yuthon_issue/views/issue_approval_views.xml
index b3033a1bf..5bd3ae97f 100644
--- a/yuthon_issue/views/issue_approval_views.xml
+++ b/yuthon_issue/views/issue_approval_views.xml
@@ -4,7 +4,7 @@
issue.approval.tree
issue.approval
-
+
@@ -12,8 +12,6 @@
-
-
@@ -25,17 +23,21 @@
diff --git a/yuthon_issue/views/issue_library_views.xml b/yuthon_issue/views/issue_library_views.xml
index fd8c2e86c..2955d2cbd 100644
--- a/yuthon_issue/views/issue_library_views.xml
+++ b/yuthon_issue/views/issue_library_views.xml
@@ -16,7 +16,7 @@
-
+
@@ -42,7 +42,7 @@
-
+
@@ -139,7 +139,7 @@
-
+
@@ -278,6 +278,14 @@
action = model.all_issue_pull()
+
+ 批量上会
+
+
+ code
+ action = model.all_meeting_issue()
+
+
审批中
issue.library
diff --git a/yuthon_performance/models/yuthon_Index_management.py b/yuthon_performance/models/yuthon_Index_management.py
index a5f49828b..a4510b208 100644
--- a/yuthon_performance/models/yuthon_Index_management.py
+++ b/yuthon_performance/models/yuthon_Index_management.py
@@ -9,7 +9,7 @@ class YuthonIndexManagement(models.Model):
dimension = fields.Char('维度', required=True)
development_goals = fields.Char('发展目标', required=True)
index_name = fields.Char('指标名称', required=True)
- index_definition = fields.Char('指标定义', required=True)
+ index_definition = fields.Text('指标定义', required=True)
index_type = fields.Selection([('kpi', 'KPI'),
('gs', 'GS'),
('refused_index', '否决指标'),],'指标类别')
@@ -19,7 +19,7 @@ class YuthonIndexManagement(models.Model):
('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='角色')
+ in_charge_role_ids = fields.Many2many('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='失效时间')
diff --git a/yuthon_performance/models/yuthon_assessment_tasks.py b/yuthon_performance/models/yuthon_assessment_tasks.py
index ed22e352d..08a912302 100644
--- a/yuthon_performance/models/yuthon_assessment_tasks.py
+++ b/yuthon_performance/models/yuthon_assessment_tasks.py
@@ -13,6 +13,21 @@ class YuthonAssessmentTasks(models.Model):
organization_id = fields.Many2one('yuthon.duty.management', string='关联组织任务 ', ondelete='cascade')
assessment_ids = fields.One2many('yuthon.assessment.tasks.lines', 'assessment_id', string='考核任务明细')
+ def button_appraisals_ids(self):
+ if self.performance_type == 'organize':
+ res_model = 'yuthon.duty.management'
+ id = self.organization_id.id #
+ else:
+ res_model = 'yuthon.employee.performance'
+ id = self.performance_id.id #
+ self.ensure_one()
+ return {
+ 'type': 'ir.actions.act_window',
+ 'res_model': res_model,
+ 'res_id': id,
+ 'view_mode': 'form',
+ 'target': 'current',
+ }
def button_appraisal_ids(self):
return {
@@ -35,6 +50,10 @@ class YuthonAssessmentTasks(models.Model):
def pub_alert_people(self):
pass
+ def unlink(self):
+ return super().unlink()
+
+
class YuthonAssessmentTasksLines(models.Model):
_name = 'yuthon.assessment.tasks.lines'
diff --git a/yuthon_performance/models/yuthon_duty_management.py b/yuthon_performance/models/yuthon_duty_management.py
index 18fd1d3dd..cbf14257c 100644
--- a/yuthon_performance/models/yuthon_duty_management.py
+++ b/yuthon_performance/models/yuthon_duty_management.py
@@ -71,7 +71,7 @@ class YuthonKpiLine(models.Model):
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="指标定义")
+ duty_index_definition = fields.Text(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)
diff --git a/yuthon_performance/models/yuthon_employee_appraisal.py b/yuthon_performance/models/yuthon_employee_appraisal.py
index d47efbeac..a126f2e67 100644
--- a/yuthon_performance/models/yuthon_employee_appraisal.py
+++ b/yuthon_performance/models/yuthon_employee_appraisal.py
@@ -23,7 +23,7 @@ class YuthonAppraisalLineDetail(models.Model):
_description = '员工绩效考核明细行'
appraisal_id = fields.Many2one('yuthon.employee.appraisal', string='关联员工绩效')
- evaluation_id = fields.Many2one('yuthon_employee_performance', string='关联考核任务(员工)')
+ evaluation_id = fields.Many2one('yuthon.employee.performance', string='关联考核任务(员工)')
evaluation_dimensions = fields.Char(string='评价维度')
illustrate = fields.Char(string='说明')
grade = fields.Float(string='评分')
diff --git a/yuthon_performance/models/yuthon_employee_performance.py b/yuthon_performance/models/yuthon_employee_performance.py
index 6f2724645..ef99611ad 100644
--- a/yuthon_performance/models/yuthon_employee_performance.py
+++ b/yuthon_performance/models/yuthon_employee_performance.py
@@ -1,5 +1,5 @@
from odoo import models, fields, api, exceptions, _
-
+from odoo.exceptions import ValidationError, UserError
class YuthonEmployeePerformance(models.Model):
_name = 'yuthon.employee.performance'
@@ -60,10 +60,16 @@ class YuthonRoleDetailLines(models.Model):
_name = 'yuthon.role.detail.lines'
_description = "考核角色明细行"
- role_id = fields.Many2one('yuthon.employee.performance', string="考核角色明细行")
+ role_id = fields.Many2one('yuthon.employee.performance', string="关联员工绩效(考核任务)")
organization_id = fields.Many2one('yuthon.duty.management', string='组织绩效考核角色明细行')
job_id = fields.Many2one('hr.job', string="考核角色")
employee_id = fields.Many2one('hr.employee', string="人员")
- weight = fields.Float(string="权重")
-
+ weight = fields.Float(string="权重" )
+ #
+ # @api.onchange('role_id', 'weight')
+ # def _onchange_weight(self):
+ # if self.role_id and self.weight:
+ # total_weight = sum(self.search([('role_id', '=', self.role_id.id)]).mapped('weight'))
+ # if total_weight > 100:
+ # raise UserError('每个考核任务的权重之和不能大于 100%!')
diff --git a/yuthon_performance/models/yuthon_grading_tasks.py b/yuthon_performance/models/yuthon_grading_tasks.py
index f22712f36..d0bad02db 100644
--- a/yuthon_performance/models/yuthon_grading_tasks.py
+++ b/yuthon_performance/models/yuthon_grading_tasks.py
@@ -19,10 +19,10 @@ class YuthonGSDetailLines(models.Model):
gs_id = fields.Many2one("yuthon.grading.tasks", string="关联GS评分表")
gst_name = fields.Char(string='GS指标名称')
weight = fields.Float(string='权重')
- assessment_tasks = fields.Char(string='上半年考核任务')
- quality_instructions = fields.Char(string='完成质量说明')
- node_description = fields.Char(string='完成节点说明')
- fact_sheet = fields.Char(string='组织绩效办公室核实情况说明')
+ assessment_tasks = fields.Text(string='上半年考核任务')
+ quality_instructions = fields.Text(string='完成质量说明')
+ node_description = fields.Text(string='完成节点说明')
+ fact_sheet = fields.Text(string='组织绩效办公室核实情况说明')
quality_score = fields.Float(string='质量得分')
node_score = fields.Float(string='节点得分')
total_scores = fields.Float(string='合计得分')
diff --git a/yuthon_performance/models/yuthon_index_employee.py b/yuthon_performance/models/yuthon_index_employee.py
index e66d41165..42747ab62 100644
--- a/yuthon_performance/models/yuthon_index_employee.py
+++ b/yuthon_performance/models/yuthon_index_employee.py
@@ -5,20 +5,15 @@ class YuthonIndexEmployee(models.Model):
_name = 'yuthon.index.employee'
_description = '员工绩效标准库'
- name = fields.Char('指标库', required=True)
- dimension = fields.Char('维度', required=True)
- less_50_points = fields.Char(string='50分以下')
- _51_to_60_points = fields.Char(string='51-60分')
- _61_to_80_points = fields.Char(string='61-80分')
- _81_to_100_points = fields.Char(string='81-100分')
+ name = fields.Char('标题', required=True)
start_index_time = fields.Date(string='生效时间', required=True)
end_index_time = fields.Date(string='失效时间')
- in_charge_role = fields.Many2one('soong.user.role', string='角色')
+ users_role_ids = fields.Many2many('soong.user.role', string='角色')
department_ids = fields.Many2many('hr.department', string='部门')
- employee_id = fields.Many2one('hr.employee', string="人员")
-
+ employee_ids = fields.Many2many('hr.employee', string='人员')
+ dimension = 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(
@@ -33,4 +28,13 @@ class YuthonIndexEmployee(models.Model):
'context': {'default_change_employee_library_ids':index_applicant_data
}}
def put_assessment_tasks1_approval(self):
- pass
\ No newline at end of file
+ pass
+
+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('评分内容')
+
diff --git a/yuthon_performance/models/yuthon_kpi_tasks.py b/yuthon_performance/models/yuthon_kpi_tasks.py
index 6490b4164..cf4f493f2 100644
--- a/yuthon_performance/models/yuthon_kpi_tasks.py
+++ b/yuthon_performance/models/yuthon_kpi_tasks.py
@@ -3,7 +3,7 @@ from odoo import models, fields, api, exceptions, _
class YuthonKpiTasks(models.Model):
_name = 'yuthon.kpi.tasks'
- _description = 'KPI Tasks'
+ _description = 'KPI '
name = fields.Char(string='名称', required=True)
@@ -29,7 +29,7 @@ class YuthonKpiDetailLines(models.Model):
efforts_value = fields.Float(string='努力值')
calculation_method = fields.Char(string='计算方法')
unit = fields.Char(string='计算单位')
- current_value = fields.Float(string='当前完成值')
+ current_value = fields.Text(string='当前完成值')
complete_sheet = fields.Text(string='完成情况说明')
score = fields.Float(string='得分')
total_score = fields.Float(string='总分')
diff --git a/yuthon_performance/security/ir.model.access.csv b/yuthon_performance/security/ir.model.access.csv
index 3f903d208..2eb953181 100644
--- a/yuthon_performance/security/ir.model.access.csv
+++ b/yuthon_performance/security/ir.model.access.csv
@@ -20,4 +20,5 @@ access_yuthon_employee_appraisal,yuthon_employee_appraisal,model_yuthon_employee
access_yuthon_appraisal_line_detail,yuthon_appraisal_line_detail,model_yuthon_appraisal_line_detail,base.group_user,1,1,1,1
access_yuthon_role_detail_lines,yuthon_role_detail_lines,model_yuthon_role_detail_lines,base.group_user,1,1,1,1
access_yuthon_assessment_tasks_lines,yuthon_assessment_tasks_lines,model_yuthon_assessment_tasks_lines,base.group_user,1,1,1,1
-access_yuthon_assessment_tasks_wizard,yuthon_assessment_tasks_wizard,model_yuthon_assessment_tasks_wizard,base.group_user,1,1,1,1
\ No newline at end of file
+access_yuthon_assessment_tasks_wizard,yuthon_assessment_tasks_wizard,model_yuthon_assessment_tasks_wizard,base.group_user,1,1,1,1
+access_yuthon_yuthon_index_employee_line,yuthon_index_employee_line,model_yuthon_index_employee_line,base.group_user,1,1,1,1
\ No newline at end of file
diff --git a/yuthon_performance/views/yuthon_Index_approval.xml b/yuthon_performance/views/yuthon_Index_approval.xml
index 2a6d59946..1cecbba6e 100644
--- a/yuthon_performance/views/yuthon_Index_approval.xml
+++ b/yuthon_performance/views/yuthon_Index_approval.xml
@@ -36,7 +36,7 @@
-
+
@@ -46,7 +46,7 @@
-
+
diff --git a/yuthon_performance/views/yuthon_Index_management.xml b/yuthon_performance/views/yuthon_Index_management.xml
index efc76ec31..001ddc713 100644
--- a/yuthon_performance/views/yuthon_Index_management.xml
+++ b/yuthon_performance/views/yuthon_Index_management.xml
@@ -19,7 +19,7 @@
-
+
@@ -50,7 +50,7 @@
-
+
diff --git a/yuthon_performance/views/yuthon_assessment_tasks.xml b/yuthon_performance/views/yuthon_assessment_tasks.xml
index a8b3e33f4..3372b748f 100644
--- a/yuthon_performance/views/yuthon_assessment_tasks.xml
+++ b/yuthon_performance/views/yuthon_assessment_tasks.xml
@@ -4,14 +4,16 @@
yuthon.assessment.tasks.tree
yuthon.assessment.tasks
-
+
-
+
+
+
diff --git a/yuthon_performance/views/yuthon_duty_approval.xml b/yuthon_performance/views/yuthon_duty_approval.xml
index 9a9bc940f..200d67fbf 100644
--- a/yuthon_performance/views/yuthon_duty_approval.xml
+++ b/yuthon_performance/views/yuthon_duty_approval.xml
@@ -46,7 +46,7 @@
-
+
@@ -60,7 +60,7 @@
-
+
diff --git a/yuthon_performance/views/yuthon_employee_approval.xml b/yuthon_performance/views/yuthon_employee_approval.xml
index d4bb8e0ae..f422c01cc 100644
--- a/yuthon_performance/views/yuthon_employee_approval.xml
+++ b/yuthon_performance/views/yuthon_employee_approval.xml
@@ -37,10 +37,9 @@
-
-
-
+
+
diff --git a/yuthon_performance/views/yuthon_employee_performance.xml b/yuthon_performance/views/yuthon_employee_performance.xml
index 97679d0dd..ce49470ca 100644
--- a/yuthon_performance/views/yuthon_employee_performance.xml
+++ b/yuthon_performance/views/yuthon_employee_performance.xml
@@ -53,7 +53,7 @@
-
+
diff --git a/yuthon_performance/views/yuthon_grading_tasks.xml b/yuthon_performance/views/yuthon_grading_tasks.xml
index 453be738b..b4ea14cb3 100644
--- a/yuthon_performance/views/yuthon_grading_tasks.xml
+++ b/yuthon_performance/views/yuthon_grading_tasks.xml
@@ -34,7 +34,7 @@
-
+
diff --git a/yuthon_performance/views/yuthon_index_employee.xml b/yuthon_performance/views/yuthon_index_employee.xml
index 03e9088e1..a5749ed26 100644
--- a/yuthon_performance/views/yuthon_index_employee.xml
+++ b/yuthon_performance/views/yuthon_index_employee.xml
@@ -9,14 +9,9 @@
-
-
-
-
-
-
-
+
+
@@ -33,26 +28,31 @@
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/yuthon_performance/views/yuthon_kpi_tasks.xml b/yuthon_performance/views/yuthon_kpi_tasks.xml
index f1aa3cc5b..fbd82c2bb 100644
--- a/yuthon_performance/views/yuthon_kpi_tasks.xml
+++ b/yuthon_performance/views/yuthon_kpi_tasks.xml
@@ -34,7 +34,7 @@
-
+
diff --git a/yuthon_performance/wizard/yuthon_assessment_tasks_wizard_views.xml b/yuthon_performance/wizard/yuthon_assessment_tasks_wizard_views.xml
index ecf4d9513..b911f4649 100644
--- a/yuthon_performance/wizard/yuthon_assessment_tasks_wizard_views.xml
+++ b/yuthon_performance/wizard/yuthon_assessment_tasks_wizard_views.xml
@@ -10,7 +10,7 @@
-
+