diff --git a/yuthon_hr_employee_approval/__manifest__.py b/yuthon_hr_employee_approval/__manifest__.py index 6c34c0f0e..e3ff30809 100644 --- a/yuthon_hr_employee_approval/__manifest__.py +++ b/yuthon_hr_employee_approval/__manifest__.py @@ -50,6 +50,7 @@ 'views/yuthon_appointment_approval_views.xml', 'views/yuthon_transfer_approval_views.xml', 'views/yuthon_social_files_approval_view.xml', + 'views/yuthon_intern_increment_views.xml', 'views/website_employee_views.xml', 'views/menuitem.xml', @@ -63,6 +64,8 @@ 'report/renewal_approval_template.xml', 'report/service_approval_report.xml', 'report/service_approval_report_templates.xml', + 'report/yuthon_intern_increment_report.xml', + 'report/yuthon_intern_increment_report_templates.xml', 'wizard/yuthon_website_employee_wizard.xml', 'wizard/interview_approval_wizard.xml', diff --git a/yuthon_hr_employee_approval/data/process_code_data.xml b/yuthon_hr_employee_approval/data/process_code_data.xml index 343127c40..aaf3d24d4 100644 --- a/yuthon_hr_employee_approval/data/process_code_data.xml +++ b/yuthon_hr_employee_approval/data/process_code_data.xml @@ -168,4 +168,11 @@ 3 + + 实习生增员申请表-编号 + yuthon_intern_increment_code + SX%(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 900eecc9f..93e5a69f7 100644 --- a/yuthon_hr_employee_approval/models/__init__.py +++ b/yuthon_hr_employee_approval/models/__init__.py @@ -28,4 +28,5 @@ from . import yuthon_renewal_approval from . import contract_review_approval from . import yuthon_employee_add from . import yuthon_pre_examination -from . import yuthon_employee_setting \ No newline at end of file +from . import yuthon_employee_setting +from . import yuthon_intern_increment \ No newline at end of file diff --git a/yuthon_hr_employee_approval/models/yuthon_intern_increment.py b/yuthon_hr_employee_approval/models/yuthon_intern_increment.py new file mode 100644 index 000000000..3446afb89 --- /dev/null +++ b/yuthon_hr_employee_approval/models/yuthon_intern_increment.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# 实习生增员申请表模型 +from odoo import models, fields, api + + +class YuthonInternIncrement(models.Model): + _name = 'yuthon.intern.increment' + _description = '实习生增员申请表' + _inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin'] + + code = fields.Char(string='编号', + default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_intern_increment_code')) + name = fields.Char(string='标题') + 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='申请部门') + company_id = fields.Many2one(related='users_id.employee_id.company_id', string='公司') + application_date = fields.Date(string='申请日期', default=fields.Date.today) + intern_position = fields.Char(string='实习岗位') + current_staff_count = fields.Integer(string='部门现有人数') + increment_count = fields.Integer(string='拟增员人数') + planned_report_date = fields.Date(string='计划报到日期') + increment_reason = fields.Text(string='增员理由') + job_content = fields.Text(string='工作内容(主要职责)') + qualifications = fields.Text(string='任职资格(学历、专业、资质及相关要求)') + dept_manager_opinion = fields.Text(string='申请部门经理意见') + hr_opinion = fields.Text(string='综合办公室意见') + management_opinion = fields.Text(string='经营班子审批意见') + documents_ids = fields.Many2many('ir.attachment', string='附件') + work_end = fields.Boolean(string='结束') + active = fields.Boolean('Active', default=True, tracking=True) + urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], + string='紧急度', default='normal') + + def _get_default_name_title(self): + return self._description if self._description else self._name + + name_title = fields.Char(default=_get_default_name_title) + self_users_ids = fields.Many2many('res.users', string='当前经办人', + default=lambda self: [(6, 0, [self.env.user.id])]) + + def action_print_intern_increment(self): + """打印实习生增员申请表""" + self.ensure_one() + report_ref = self.env.ref('yuthon_hr_employee_approval.action_intern_increment_report') + return report_ref.report_action(self.id) diff --git a/yuthon_hr_employee_approval/report/yuthon_intern_increment_report.xml b/yuthon_hr_employee_approval/report/yuthon_intern_increment_report.xml new file mode 100644 index 000000000..1f0ce21b0 --- /dev/null +++ b/yuthon_hr_employee_approval/report/yuthon_intern_increment_report.xml @@ -0,0 +1,20 @@ + + + + + + + 实习生增员申请表 + + yuthon.intern.increment + qweb-pdf + yuthon_hr_employee_approval.intern_increment_report_document + yuthon_hr_employee_approval.intern_increment_report_document + + + report + + '实习生增员申请表_%s_%s_%s' % (object.name or '', object.users_id.name or '', ((object.log_ids.filtered(lambda l: l.name == '归档')[-1].lase_click_date or object.log_ids.filtered(lambda l: l.name == '归档')[-1].date_create).strftime('%Y-%m-%d') if object.log_ids.filtered(lambda l: l.name == '归档') else '')) + + + diff --git a/yuthon_hr_employee_approval/report/yuthon_intern_increment_report_templates.xml b/yuthon_hr_employee_approval/report/yuthon_intern_increment_report_templates.xml new file mode 100644 index 000000000..428b40d7b --- /dev/null +++ b/yuthon_hr_employee_approval/report/yuthon_intern_increment_report_templates.xml @@ -0,0 +1,140 @@ + + + + + + + diff --git a/yuthon_hr_employee_approval/security/ir.model.access.csv b/yuthon_hr_employee_approval/security/ir.model.access.csv index b1490c749..7d4fbf91f 100644 --- a/yuthon_hr_employee_approval/security/ir.model.access.csv +++ b/yuthon_hr_employee_approval/security/ir.model.access.csv @@ -56,6 +56,7 @@ access_contract_review_approval,contract_review_approval,model_contract_review_a access_awards_line, awards_line,model_awards_line,base.group_user,1,1,1,1 access_yuthon_employee_add,yuthon_employee_add,model_yuthon_employee_add,base.group_user,1,1,1,1 access_yuthon_pre_examination,yuthon_pre_examination,model_yuthon_pre_examination,base.group_user,1,1,1,1 +access_yuthon_intern_increment,yuthon_intern_increment,model_yuthon_intern_increment,base.group_user,1,1,1,1 access_yuthon_service_type,yuthon_service_type,model_yuthon_service_type,base.group_user,1,1,1,1 access_yuthon_contract_type,yuthon_contract_type,model_yuthon_contract_type,base.group_user,1,1,1,1 access_leaving_salary_line,leaving_salary_line,model_leaving_salary_line,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/yuthon_hr_employee_approval/views/menuitem.xml b/yuthon_hr_employee_approval/views/menuitem.xml index b12a5cda6..765c915a9 100644 --- a/yuthon_hr_employee_approval/views/menuitem.xml +++ b/yuthon_hr_employee_approval/views/menuitem.xml @@ -8,10 +8,10 @@ parent="hr_recruitment.menu_hr_recruitment_root" sequence="7"/> + name="招聘需求申请表" + parent="hr_process_work_job" + action="yuthon_recruitment_approval_action" + sequence="1"/> + + + yuthon.intern.increment.tree + yuthon.intern.increment + + + + + + + + + + + + + + + + yuthon.intern.increment.form + yuthon.intern.increment + +
+
+ +
+ + + + + + + + + + + +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + 实习生增员申请表 + yuthon.intern.increment + tree,form + +
diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml index 157dd4e11..d14b67bca 100644 --- a/yuthon_work_brand/views/hr_menus.xml +++ b/yuthon_work_brand/views/hr_menus.xml @@ -65,6 +65,11 @@ parent="hr_menu_recruitment_process" action="yuthon_hr_employee_approval.yuthon_recruitment_approval_action" sequence="1"/> +