diff --git a/yuthon_hr_employee_approval/__manifest__.py b/yuthon_hr_employee_approval/__manifest__.py
index c19e55ee2..fc98ef722 100644
--- a/yuthon_hr_employee_approval/__manifest__.py
+++ b/yuthon_hr_employee_approval/__manifest__.py
@@ -24,6 +24,7 @@
'views/yuthon_message_login_views.xml',
'views/yuthon_onboard_approval_views.xml',
'views/yuthon_enrollment_approval_views.xml',
+ 'views/yuthon_retired_approval_views.xml',
'views/yuthon_account_approval_views.xml',
'views/yuthon_interview_approval_views.xml',
'views/yuthon_leaving_approval_views.xml',
diff --git a/yuthon_hr_employee_approval/data/process_code_data.xml b/yuthon_hr_employee_approval/data/process_code_data.xml
index 8e065768b..dfaef670e 100644
--- a/yuthon_hr_employee_approval/data/process_code_data.xml
+++ b/yuthon_hr_employee_approval/data/process_code_data.xml
@@ -104,4 +104,10 @@
3
+
+ 退休申请表-编号
+ yuthon_retired_approval_code
+ TX%(y)s%(month)s%(day)s
+ 3
+
diff --git a/yuthon_hr_employee_approval/models/__init__.py b/yuthon_hr_employee_approval/models/__init__.py
index 58d0e1059..05cb1dfb5 100644
--- a/yuthon_hr_employee_approval/models/__init__.py
+++ b/yuthon_hr_employee_approval/models/__init__.py
@@ -19,4 +19,5 @@ from . import yuthon_system_approval
from . import yuthon_service_approval
from . import yuthon_social_files_approval
from . import yuthon_appointment_approval
-from . import yuthon_transfer_approval
\ No newline at end of file
+from . import yuthon_transfer_approval
+from . import yuthon_retired_approval
\ No newline at end of file
diff --git a/yuthon_hr_employee_approval/models/inherit_hr_employee.py b/yuthon_hr_employee_approval/models/inherit_hr_employee.py
index 51f748d71..40d6ef428 100644
--- a/yuthon_hr_employee_approval/models/inherit_hr_employee.py
+++ b/yuthon_hr_employee_approval/models/inherit_hr_employee.py
@@ -39,6 +39,22 @@ class YuthonHrEmployee(models.Model):
}
+ def pub_retired_employee(self):
+ record_id = self.env["hr.employee"].browse(self._context.get('active_ids', self._context.get('active_id')))
+ user_id = record_id.user_id
+ if len(record_id) != 1:
+ raise UserError("请选择一个员工")
+ form_id = self.env.ref('yuthon_hr_employee_approval.view_retired_approval_form').id
+ return {
+ "type": "ir.actions.act_window",
+ "name": "退休申请",
+ "res_model": "yuthon.retired.approval",
+ "views": [[form_id, "form"]],
+ "context": {
+ 'default_employee_id':user_id.employee_id.id,
+ }
+ }
+
def pub_regularization_employee(self):
record_id = self.env["hr.employee"].browse(self._context.get('active_ids', self._context.get('active_id')))
user_id = record_id.user_id
@@ -54,3 +70,4 @@ class YuthonHrEmployee(models.Model):
'default_employee_id':user_id.id,
}
}
+
diff --git a/yuthon_hr_employee_approval/models/yuthon_leaving_approval.py b/yuthon_hr_employee_approval/models/yuthon_leaving_approval.py
index fba07172b..d01185e6f 100644
--- a/yuthon_hr_employee_approval/models/yuthon_leaving_approval.py
+++ b/yuthon_hr_employee_approval/models/yuthon_leaving_approval.py
@@ -7,48 +7,29 @@ class YuthonLeavingApproval(models.Model):
_description = '离职申请'
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
+ name = fields.Char(string='标题')
+ text = fields.Text(string='正文')
+ code = fields.Char(string="编号",
+ default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_leaving_approval_code'))
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
- department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
- contract = fields.Many2one('hr.contract', string='合同')
- code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_leaving_approval_code'))
- 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_type_id = fields.Many2one('hr.job.type', string="岗位类别")
- onboarding_date = fields.Date(related='users_id.employee_id.open_start_time',string="入职日期")
- end_of_contract = fields.Date(string="合同结束日期")
+ reason_application = fields.Text(string="事由")
+ employee_id = fields.Many2one('hr.employee', string="员工")
+ department_id = fields.Many2one(related='employee_id.department_id', string="部门")
+ phone = fields.Char(related='employee_id.mobile_phone', string="联系方式")
+ documents_ids = fields.Many2many('ir.attachment', string="附件")
+ id_number = fields.Char(related='employee_id.identification_id', string="身份证号")
+ job_id = fields.Many2one(related='employee_id.job_id', string="岗位")
+ onboarding_time = fields.Date(related='employee_id.open_start_time', string="入职日期")
expected_departure_date = fields.Date(string="预计离职日期")
- parent_id = fields.Many2one(related='users_id.employee_id.parent_id', string="直线上级")
- business_superior = fields.Many2one("hr.employee", string="业务上级")
- use_user_type = fields.Selection(related="users_id.employee_id.use_user_type", string="聘用形式")
- type_resignation = fields.Selection([('1', '个人辞职'), ('2', '被动离职')], string="辞职类型")
- application_data = fields.Date(string="申请日期")
- notice_documents_ids= fields.Many2many('ir.attachment', string="辞职申请")
- resignation_reason = fields.Text(string="辞职原因")
- is_issues = fields.Boolean(string='是否上会')
- related_issues_id = fields.Many2one('issue.library', string="关联议题")
- is_leaving = fields.Boolean(string="同意离职")
- leaving_date = fields.Date(string="工作期限")
- handover_person = fields.Many2one("hr.employee", string="交接人")
- is_handover = fields.Boolean(string="交接完成")
-
- @api.onchange('is_issues')
- def _onchange_is_issues(self):
- if self.is_issues:
- issue_id = self.env['issue.library'].create({'name': self.name})
- self.related_issues_id = issue_id.id
- workflow_record_id = self.env["soong.workflow.record"].search([("res_model", "=", self._name), ("res_id", "=", self.id)])
- self.env['issue.library.approval.line'].create({
- 'issue_library_id': issue_id.id,
- 'workflow_record_id': workflow_record_id.id,
- 'approval_type': workflow_record_id.workflow_id.id,
- 'code': self.code,
- 'approval_date': fields.Datetime.now(),
- })
- elif self.related_issues_id:
- raise UserError("已经创建了相关的上会记录,不能取消勾选")
+ departure_type = fields.Selection([
+ ('voluntary', '主动离职'),
+ ('contract_expired', '合同到期'),
+ ('negotiated_termination', '协商解除'),
+ ('other', '其他')
+ ], string='离职类型')
+ handover_line_ids = fields.One2many('yuthon.handover.line', 'leaving_id', string="工作交接")
+ return_line_ids = fields.One2many('yuthon.return.line', 'leaving_id', string="资产归还")
+ goods_line_ids = fields.One2many('yuthon.goods.line', 'leaving_id', string="物品交接")
class HrJobType(models.Model):
_name = "hr.job.type"
diff --git a/yuthon_hr_employee_approval/models/yuthon_retired_approval.py b/yuthon_hr_employee_approval/models/yuthon_retired_approval.py
new file mode 100644
index 000000000..5b9e9272d
--- /dev/null
+++ b/yuthon_hr_employee_approval/models/yuthon_retired_approval.py
@@ -0,0 +1,68 @@
+from odoo import models, fields, api
+from odoo.exceptions import UserError
+
+
+class YuthonRetiredApproval(models.Model):
+ _name = 'yuthon.retired.approval'
+ _description = '退休申请表'
+
+ name = fields.Char(string='标题')
+ text = fields.Text(string='正文')
+ code = fields.Char(string="编号",
+ default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_retired_approval_code'))
+ users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
+ reason_application = fields.Text(string="事由")
+ employee_id = fields.Many2one('hr.employee', string="员工")
+ department_id = fields.Many2one(related='employee_id.department_id', string="部门")
+ phone = fields.Char(related='employee_id.mobile_phone', string="联系方式")
+ id_number = fields.Char(related='employee_id.identification_id', string="身份证号")
+ job_id = fields.Many2one(related='employee_id.job_id', string="岗位")
+ onboarding_time = fields.Date(related='employee_id.open_start_time', string="入职日期")
+ expected_departure_date = fields.Date(string="预计离职日期")
+ retirement_type = fields.Selection([('normal', '正常退休'), ('special_job_early', '特殊工种提前退休'), ('sick', '病退')], string='退休类型')
+ social_security_card = fields.Char(string='社保卡')
+ treatment_choice = fields.Selection([('pension_payment', '养老金发放'), ('enterprise_annuity', '企业年金')], string='待遇选择')
+ account = fields.Char(string='账号')
+ documents_ids = fields.Many2many('ir.attachment', string="附件")
+ handover_line_ids = fields.One2many('yuthon.handover.line', 'retired_id', string="工作交接")
+ return_line_ids = fields.One2many('yuthon.return.line', 'retired_id', string="资产归还")
+ goods_line_ids = fields.One2many('yuthon.goods.line', 'retired_id', string="物品交接")
+
+
+class YuthonHandoverLine(models.Model):
+ _name = 'yuthon.handover.line'
+ _description = '工作交接'
+
+ name = fields.Char(string="交接事项")
+ employee_id = fields.Many2one('hr.employee', string="交接人")
+ state = fields.Selection([('done', '已完成'), ('undone', '未完成')], string="交接状态")
+ remake = fields.Char(string="备注")
+ retired_id = fields.Many2one('yuthon.retired.approval', string="关联退休申请")
+ leaving_id = fields.Many2one('yuthon.leaving.approval', string="关联离职申请")
+
+
+class YuthonReturnLine(models.Model):
+ _name = 'yuthon.return.line'
+ _description = '资产归还'
+
+ name = fields.Char(string="资产类型")
+ model = fields.Char(string="型号")
+ state = fields.Selection([('done', '已完成'), ('undone', '未完成')], string="归还状态")
+ remake = fields.Char(string="备注")
+ retired_id = fields.Many2one('yuthon.retired.approval', string="关联退休申请")
+ leaving_id = fields.Many2one('yuthon.leaving.approval', string="关联离职申请")
+
+
+class YuthonGoodsLine(models.Model):
+ _name = 'yuthon.goods.line'
+ _description = '办公用品'
+
+ name = fields.Char(string="物品名称")
+ number = fields.Integer(string="数量")
+ state = fields.Selection([('done', '已完成'), ('undone', '未完成')], string="归还状态")
+ remake = fields.Char(string="备注")
+ retired_id = fields.Many2one('yuthon.retired.approval', string="关联退休申请")
+ leaving_id = fields.Many2one('yuthon.leaving.approval', string="关联离职申请")
+
+
+
diff --git a/yuthon_hr_employee_approval/security/ir.model.access.csv b/yuthon_hr_employee_approval/security/ir.model.access.csv
index 3969da1fd..3ab47bd7e 100644
--- a/yuthon_hr_employee_approval/security/ir.model.access.csv
+++ b/yuthon_hr_employee_approval/security/ir.model.access.csv
@@ -40,4 +40,8 @@ access_yuthon_reward_punishment_details,yuthon_reward_punishment_details,model_y
access_yuthon_trial_scenario_detail_line,yuthon_trial_scenario_detail_line,model_yuthon_trial_scenario_detail_line,base.group_user,1,1,1,1
access_interview_approval_wizard,interview_approval_wizard,model_interview_approval_wizard,base.group_user,1,1,1,1
access_interview_approval_wizard_line,interview_approval_wizard_line,model_interview_approval_wizard_line,base.group_user,1,1,1,1
-access_kindred_line,kindred_line,model_kindred_line,base.group_user,1,1,1,1
\ No newline at end of file
+access_kindred_line,kindred_line,model_kindred_line,base.group_user,1,1,1,1
+access_yuthon_retired_approval,yuthon_retired_approval,model_yuthon_retired_approval,base.group_user,1,1,1,1
+access_yuthon_handover_line,yuthon_handover_line,model_yuthon_handover_line,base.group_user,1,1,1,1
+access_yuthon_return_line,yuthon_return_line,model_yuthon_return_line,base.group_user,1,1,1,1
+access_yuthon_goods_line,yuthon_goods_line,model_yuthon_goods_line,base.group_user,1,1,1,1
\ No newline at end of file
diff --git a/yuthon_hr_employee_approval/views/inherit_hr_employee_views.xml b/yuthon_hr_employee_approval/views/inherit_hr_employee_views.xml
index 0325621bf..87cc4bbac 100644
--- a/yuthon_hr_employee_approval/views/inherit_hr_employee_views.xml
+++ b/yuthon_hr_employee_approval/views/inherit_hr_employee_views.xml
@@ -9,6 +9,7 @@
+
diff --git a/yuthon_hr_employee_approval/views/yuthon_leaving_approval_views.xml b/yuthon_hr_employee_approval/views/yuthon_leaving_approval_views.xml
index 62cb6cb15..ff7aebad7 100644
--- a/yuthon_hr_employee_approval/views/yuthon_leaving_approval_views.xml
+++ b/yuthon_hr_employee_approval/views/yuthon_leaving_approval_views.xml
@@ -4,13 +4,10 @@
yuthon.leaving.approval.tree
yuthon.leaving.approval
-
-
-
-
-
-
-
+
+
+
+
@@ -24,66 +21,77 @@
-
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
员工辞职
yuthon.leaving.approval
tree,form
-
diff --git a/yuthon_hr_employee_approval/views/yuthon_retired_approval_views.xml b/yuthon_hr_employee_approval/views/yuthon_retired_approval_views.xml
new file mode 100644
index 000000000..f372830e6
--- /dev/null
+++ b/yuthon_hr_employee_approval/views/yuthon_retired_approval_views.xml
@@ -0,0 +1,107 @@
+
+
+
+ retired.approval.tree
+ yuthon.retired.approval
+
+
+
+
+
+
+
+
+
+
+
+ retired.approval.form
+ yuthon.retired.approval
+
+
+
+
+
+ 退休审批
+ yuthon.retired.approval
+ tree,form
+
+
+
+
+
+
+
+
+
diff --git a/yuthon_issue/views/inherit_room_booking.xml b/yuthon_issue/views/inherit_room_booking.xml
index 93ff398c0..92abcfa74 100644
--- a/yuthon_issue/views/inherit_room_booking.xml
+++ b/yuthon_issue/views/inherit_room_booking.xml
@@ -8,9 +8,11 @@
-
+
-
+
+
+
diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml
index eb3755bc9..f41226efb 100644
--- a/yuthon_work_brand/views/hr_menus.xml
+++ b/yuthon_work_brand/views/hr_menus.xml
@@ -206,6 +206,11 @@
parent="hr_set_process_menu_root_board"
action="yuthon_hr_employee_approval.yuthon_transfer_approval_action"
sequence="13"/>
+