Merge pull request !305 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2024-10-20 13:24:55 +00:00
committed by Gitee
31 changed files with 218 additions and 302 deletions
@@ -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='假期详情')
+1 -1
View File
@@ -11,7 +11,7 @@
<xpath expr="//field[@name='display_name']" position="attributes">
<attribute name="string">假期类型</attribute>
</xpath>
<xpath expr="//field[@name='display_name']" position="later">
<xpath expr="//field[@name='display_name']" position="before">
<field name="vacation_type_id"/>
</xpath>
<xpath expr="//field[@name='allocation_validation_type']" position="attributes">
@@ -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': '请假详情',
@@ -6,7 +6,6 @@
<field name="model">holidays.approval</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="company_page"/>
<field name="applicant_id"/>
<field name="department_id"/>
@@ -23,12 +22,6 @@
<!-- <button name="holiday_approval" string="发起申请" type="object" class="oe_highlight"/>-->
<!-- </header>-->
<sheet>
<div class="oe_title">
<label for="name"/>
<h1>
<field name="name" required="1"/>
</h1>
</div>
<group col="3">
<group>
<field name="code"/>
@@ -51,10 +44,11 @@
<field name="leave_type_id" string="假期类型"/>
<field name="days_available" readonly="1" sum="Total" force_save="1"/>
<field name="applicants" readonly="1" force_save="1"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="leave_days" sum="Total"/>
<field name="surplus_days" sum="Total"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="name"/>
<button name="button_holiday_detail" string="假期详情" class="oe_highlight" type="object"/>
</tree>
</field>
+1 -21
View File
@@ -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
+30 -87
View File
@@ -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)
+45 -26
View File
@@ -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)],
}
}
+1 -1
View File
@@ -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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
5 access_issue_approval_decision_type issue_approval_decision_type model_issue_approval_decision_type base.group_user 1 1 1 1
6 access_issue_library_approval_line issue_library_approval_line model_issue_library_approval_line base.group_user 1 1 1 1
7 access_issue_approval issue_approval model_issue_approval base.group_user 1 1 1 1
8 access_issue_approval_room_line access_issue_approval_line issue_approval_room_line issue_approval_line model_issue_approval_room_line model_issue_approval_line base.group_user 1 1 1 1
@@ -23,51 +23,4 @@
</p>
</div>
</t>
<t t-name="yuthon_issue.table_meet_demo" owl="1">
<t t-set="data" t-value="props.record.data"/>
<table style="table-layout:fixed;border: 1px solid black;">
<thead>
<tr colspan="8" style="border: 1px solid black;">
<td colspan="2" style="border: 1px solid black;"><span style="color: black;"><strong>会议类型</strong></span></td>
<td colspan="2" style="border: 1px solid black;"><span style="color: black;"><strong>会议时间</strong></span></td>
<td colspan="2" style="border: 1px solid black;"><span style="color: black;"><strong>会议名称</strong></span></td>
<!-- <td colspan="2" style="border: 1px solid black;"><span style="color: black;"><strong>参会人员</strong></span></td>-->
<td colspan="2" style="border: 1px solid black;"><span style="color: black;"><strong>决策结果</strong></span></td>
</tr>
</thead>
<t t-esc="data.meeting_data"/>
<!-- <t t-foreach="data.meeting_data.split(';')" t-as="line" t-key="line">-->
<!-- <thead>-->
<!-- <tr colspan="8" style="border: 1px solid black;">-->
<!-- <t t-foreach="line.split('、')" t-as="l" t-key="l">-->
<td colspan="8" style="border: 1px solid black;"><span style="color: red;">☑</span></td>
<!-- <td colspan="1" style="border: 1px solid black;"><span style="color: red;">☑</span></td>-->
<!-- <td colspan="1" style="border: 1px solid black;"><span style="color: black;"><t t-esc="l"/></span></td>-->
<!-- <td colspan="2" style="border: 1px solid black;"><span style="color: black;"><t t-esc="l"/></span></td>-->
<!-- <td colspan="2" style="border: 1px solid black;"><span style="color: black;"><t t-esc="l"/></span></td>-->
<!-- &lt;!&ndash; <td colspan="2" style="border: 1px solid black;"><span style="color: black;"><strong>参会人员</strong></span></td>&ndash;&gt;-->
<!-- <td colspan="2" style="border: 1px solid black;"><span style="color: black;"><t t-esc="l"/></span></td>-->
<!-- </t>-->
<!-- </tr>-->
<!-- </thead>-->
<!-- </t>-->
<t t-if="data.is_parent_unit">
<thead>
<tr colspan="8" style="border: 1px solid black;">
<td colspan="1" style="border: 1px solid black;"><span style="color: red;">☑</span></td>
<td colspan="1" style="border: 1px solid black;"><span style="color: black;">上级单位</span></td>
<td colspan="2" style="border: 1px solid black;"/>
<td colspan="2" style="border: 1px solid black;"/>
<td colspan="2" style="border: 1px solid black;"/>
<!-- <td colspan="2" style="border: 1px solid black;"/>-->
</tr>
</thead>
</t>
</table>
</t>
</templates>
@@ -27,8 +27,8 @@
</div>
<group col="2">
<group>
<field name="sequence"/>
<field name="decision_type_id"/>
<field name="sequence"/>
<field name="child_ids" force_save="1" invisible="1"/>
</group>
<group/>
+11 -38
View File
@@ -4,7 +4,7 @@
<field name="name">issue.approval.tree</field>
<field name="model">issue.approval</field>
<field name="arch" type="xml">
<tree string="议题审批" delete="0" create="0">
<tree string="议题审批">
<field name="issue_data" column_invisible="1"/>
<field name="decision_data" column_invisible="1"/>
<field name="name"/>
@@ -12,8 +12,6 @@
<field name="department_id"/>
<field name="issue_display" widget="json_template"/>
<field name="decision_display" widget="json_template"/>
<field name="meeting_display" widget="json_template"/>
<button name="all_meeting_issue" string="安排会议" type="object" class="oe_highlight"/>
<button name="pub_meeting_minutes" string="会议纪要" type="object" class="oe_highlight"/>
</tree>
</field>
@@ -25,17 +23,21 @@
<field name="arch" type="xml">
<form string="议题审批">
<sheet>
<group col="2">
<group col="4" string="个人信息">
<group>
<field name="user_id"/>
</group>
<group>
<field name="yuthon_company"/>
<field name="is_attend"/>
</group>
<group>
<field name="job_id"/>
</group>
<group>
<field name="department_id"/>
</group>
</group>
<field name="is_attend"/>
<group string="审批事项">
<field name="name" required="1"/>
<field name="issue_text" widget="tinymce"/>
@@ -45,19 +47,17 @@
<group>
<field name="issue_display" widget="json_template" invisible="1"/>
<field name="decision_display" widget="json_template" invisible="1"/>
<field name="meeting_display" widget="json_template" invisible="1"/>
<field name="issue_data" invisible="1" force_save="1"/>
<field name="decision_data" invisible="1" force_save="1"/>
<field name="meeting_data" invisible="1" force_save="1"/>
<field name="is_parent_unit" invisible="1"/>
</group>
<notebook>
<page string="关联议题">
<field name="issue_library_ids">
<tree editable="bottom" create="false">
<field name="issue_approval_ids">
<tree editable="bottom">
<field name="issue_approval_id" column_invisible="1"/>
<field name="name"/>
<field name="issue_library_id"/>
<field name="approval_decision_sequence"/>
<field name="is_party"/>
<field name="is_class"/>
<field name="is_boss"/>
@@ -65,33 +65,6 @@
</tree>
</field>
</page>
<page string="决策清单">
<field name="approval_decision_ids" create="false">
<tree editable="bottom">
<field name="issue_approval_id" column_invisible="1"/>
<field name="specifics"/>
<field name="council" readonly="1"/>
<field name="team_meet" readonly="1"/>
<field name="board_meet" readonly="1"/>
<field name="district_bureau" readonly="1"/>
</tree>
</field>
</page>
<page string="会议详情" invisible="not is_attend">
<field name="room_approval_ids">
<tree editable="bottom" create="false">
<field name="room_approval_id" column_invisible="1"/>
<field name="meeting_type_id" readonly="1"/>
<field name="room_booking_id" readonly="1"/>
<field name="room_id" readonly="1"/>
<field name="date_start" readonly="1"/>
<field name="date_end" readonly="1"/>
<field name="room_users_ids" widget="many2many_tags" readonly="1"/>
<field name="decision_results"/>
<button name="bottom_meeting_minutes" string="会议纪要" type="object" class="oe_highlight"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
+11 -3
View File
@@ -16,7 +16,7 @@
<field name="is_boss"/>
<field name="is_note"/>
<field name="state"/>
<button name="issue_pull" string="提交" type="object" class="oe_highlight"/>
<button name="all_issue_pull" string="提交" type="object" class="oe_highlight"/>
<button name="issue_cancel" string="取消" type="object" class="oe_highlight"/>
<button name="unlink" string="删除" type="object" class="oe_highlight"/>
<!-- <field name="json_display" widget="json_template"/>-->
@@ -42,7 +42,7 @@
<group>
<group>
<field name="code"/>
<field name="notice_documents_ids" widget="many2many_tags"/>
<field name="approval_decision_sequence" invisible="1"/>
<field name="notice_documents_ids" widget="preview_many2many" string=" "/>
<!-- <field name="json_content" invisible="1"/>-->
<!-- <field name="json_display" widget="json_template" invisible="1"/>-->
@@ -139,7 +139,7 @@
<field name="is_class"/>
<field name="is_boss"/>
<field name="state"/>
<button name="issue_pull" string="提交" type="object" class="oe_highlight"/>
<button name="all_issue_pull" string="提交" type="object" class="oe_highlight"/>
<button name="issue_cancel" string="取消" type="object" class="oe_highlight"/>
<button name="unlink" string="删除" type="object" class="oe_highlight"/>
</tree>
@@ -278,6 +278,14 @@
<field name="code">action = model.all_issue_pull()</field>
</record>
<record id="all_meting_issue" model="ir.actions.server">
<field name="name">批量上会</field>
<field name="model_id" ref="yuthon_issue.model_issue_library"/>
<field name="binding_model_id" ref="yuthon_issue.model_issue_library"/>
<field name="state">code</field>
<field name="code">action = model.all_meeting_issue()</field>
</record>
<record id="issue_library_action_approval2" model="ir.actions.act_window">
<field name="name">审批中</field>
<field name="res_model">issue.library</field>
@@ -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='失效时间')
@@ -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'
@@ -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)
@@ -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='评分')
@@ -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%!')
@@ -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='合计得分')
@@ -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
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('评分内容')
@@ -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='总分')
@@ -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
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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
20 access_yuthon_appraisal_line_detail yuthon_appraisal_line_detail model_yuthon_appraisal_line_detail base.group_user 1 1 1 1
21 access_yuthon_role_detail_lines yuthon_role_detail_lines model_yuthon_role_detail_lines base.group_user 1 1 1 1
22 access_yuthon_assessment_tasks_lines yuthon_assessment_tasks_lines model_yuthon_assessment_tasks_lines base.group_user 1 1 1 1
23 access_yuthon_assessment_tasks_wizard yuthon_assessment_tasks_wizard model_yuthon_assessment_tasks_wizard base.group_user 1 1 1 1
24 access_yuthon_yuthon_index_employee_line yuthon_index_employee_line model_yuthon_index_employee_line base.group_user 1 1 1 1
@@ -36,7 +36,7 @@
<notebook>
<page string="组织绩效">
<field name="change_index_library_ids">
<tree editable="bottom">
<tree>
<field name="dimension"/>
<field name="development_goals"/>
<field name="index_name"/>
@@ -46,7 +46,7 @@
<field name="compute_type"/>
<field name="check_norm"/>
<field name="department_ids" widget="many2many_tags"/>
<field name="in_charge_role"/>
<field name="in_charge_role_ids" widget="many2many_tags"/>
<field name="employee_id"/>
<field name="start_index_time"/>
<field name="end_index_time"/>
@@ -19,7 +19,7 @@
<field name="compute_type"/>
<field name="check_norm"/>
<field name="department_ids" widget="many2many_tags"/>
<field name="in_charge_role"/>
<field name="in_charge_role_ids" widget="many2many_tags"/>
<field name="employee_id"/>
<field name="start_index_time"/>
<field name="end_index_time"/>
@@ -50,7 +50,7 @@
<field name="department_ids" widget="many2many_tags"/>
</group>
<group>
<field name="in_charge_role"/>
<field name="in_charge_role_ids" widget="many2many_tags"/>
<field name="employee_id"/>
<field name="start_index_time"/>
</group>
@@ -4,14 +4,16 @@
<field name="name">yuthon.assessment.tasks.tree</field>
<field name="model">yuthon.assessment.tasks</field>
<field name="arch" type="xml">
<tree string="责任书">
<tree string="责任书" editable="bottom" create="false">
<field name="name"/>
<field name="index_statu"/>
<field name="performance_type" string="绩效类型"/>
<field name="assessment_time" string="考核时间"/>
<field name="index_statu"/>
<button name="button_appraisal_ids" type="object" string="考核详情"/>
<button name="button_clone_task" type="object" string="克隆"/>
<button name="button_calculate_score" type="object" string="计算分数"/>
<button name="unlink" type="object" string="删除"/>
<button name="button_appraisals_ids" type="object" string="修改"/>
</tree>
</field>
</record>
@@ -46,7 +46,7 @@
<field name="compute_method"/>
<field name="unit_compute"/>
<field name="employee_id"/>
<field name="in_charge_role"/>
<field name="in_charge_role_ids" widget="many2many_tags"/>
</tree>
</field>
</group>
@@ -60,7 +60,7 @@
<field name="compute_act"/>
<field name="weight"/>
<field name="employee_id"/>
<field name="in_charge_role"/>
<field name="in_charge_role_ids" widget="many2many_tags"/>
</tree>
</field>
</group>
@@ -37,10 +37,9 @@
<page string="员工绩效">
<field name="change_employee_library_ids">
<tree editable="bottom">
<field name="dimension"/>
<field name="department_ids" widget="many2many_tags"/>
<field name="in_charge_role"/>
<field name="employee_id"/>
<field name="users_role_ids"/>
<field name="employee_ids"/>
<field name="start_index_time"/>
<field name="end_index_time"/>
</tree>
@@ -53,7 +53,7 @@
<field name="role_id" column_invisible="1"/>
<field name="job_id"/>
<field name="employee_id"/>
<field name="weight"/>
<field name="weight" sum="Total"/>
</tree>
</field>
<group>
@@ -34,7 +34,7 @@
<notebook>
<page string="GS评分表">
<field name="gs_ids">
<tree editable="bottom">
<tree>
<field name="gs_id" column_invisible="1"/>
<field name="gst_name" required="1"/>
<field name="weight" required="1"/>
@@ -9,14 +9,9 @@
<button name="put_employees_approval" type="object" string="提交员工指标变更申请"/>
<button name="put_assessment_tasks1_approval" type="object" string="提交考核任务"/>
</header>
<field name="dimension"/>
<field name="less_50_points"/>
<field name="_51_to_60_points"/>
<field name="_61_to_80_points"/>
<field name="_81_to_100_points"/>
<field name="department_ids" widget="many2many_tags"/>
<field name="in_charge_role"/>
<field name="employee_id"/>
<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"/>
</tree>
@@ -33,26 +28,31 @@
<field name="name" required="1"/>
</h1>
</div>
<group col="4">
<group>
<field name="dimension"/>
<field name="less_50_points"/>
</group>
<group col="3">
<group>
<field name="department_ids" widget="many2many_tags"/>
<field name="_51_to_60_points"/>
<field name="in_charge_role"/>
</group>
<group>
<field name="employee_id"/>
<field name="_61_to_80_points"/>
</group>
<group>
<field name="start_index_time"/>
<field name="_81_to_100_points"/>
<field name="end_index_time"/>
</group>
<group>
<field name="employee_ids" widget="many2many_tags"/>
<field name="end_index_time"/>
</group>
<group>
<field name="users_role_ids" widget="many2many_tags"/>
<field name="dimension"/>
</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>
</sheet>
</form>
</field>
@@ -34,7 +34,7 @@
<notebook>
<page string="KPI评分表">
<field name="kpi_ids">
<tree editable="bottom">
<tree>
<field name="kpi_id" coulmn_invisible="1"/>
<field name="weight"/>
<field name="kpl_name"/>
@@ -10,7 +10,7 @@
</header>
<field name="name"/>
<field name="assessment_ids">
<tree>
<tree editable="bottom">
<field name="tasks_wizard_id" column_invisible="1"/>
<field name="examiners"/>
<field name="be_examiners"/>