From dd3c130436f8e7cc9e8855cb4bd66eb3415d8451 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Mon, 17 Feb 2025 17:19:24 +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 --- soong_workflow/views/menuitem.xml | 58 ++++++++-------- yuthon_hr_attendance/models/hr_attendance.py | 6 +- yuthon_hr_employee/__manifest__.py | 2 + yuthon_hr_employee/models/__init__.py | 2 + .../models/yuthon_medical_manage.py | 21 ++++++ .../models/yuthon_medical_rule.py | 30 ++++++++ .../security/ir.model.access.csv | 4 +- .../views/inherit_hr_applicant_views.xml | 19 +++++ .../views/yuthon_medical_manage_views.xml | 27 ++++++++ .../views/yuthon_medical_rule_views.xml | 26 +++++++ .../models/inherit_hr_payroll_structure.py | 54 +++++++++++++++ .../inherit_hr_payroll_structure_views.xml | 51 ++++++++++++++ yuthon_work_brand/views/hr_menus.xml | 69 +++++++++++++------ 13 files changed, 315 insertions(+), 54 deletions(-) create mode 100644 yuthon_hr_employee/models/yuthon_medical_manage.py create mode 100644 yuthon_hr_employee/models/yuthon_medical_rule.py create mode 100644 yuthon_hr_employee/views/yuthon_medical_manage_views.xml create mode 100644 yuthon_hr_employee/views/yuthon_medical_rule_views.xml diff --git a/soong_workflow/views/menuitem.xml b/soong_workflow/views/menuitem.xml index cd68df249..ef1157dcc 100644 --- a/soong_workflow/views/menuitem.xml +++ b/soong_workflow/views/menuitem.xml @@ -6,38 +6,38 @@ name="Workflow" web_icon="soong_workflow,static/description/icon.png" sequence="2"/> - - - - - + + + + + @@ -45,14 +45,14 @@ name="流程回收站" parent="menu_soong_workflow_root" action="soong_workflow_record_action_reclaim" - sequence="7"/> + sequence="15"/> diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index 682968eae..d8432bc53 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -448,7 +448,7 @@ class HrAttendance(models.Model): self.card_out_comment(user.resource_id.employee_id,user.template_id.planning_name) def card_lc_shift_remind_on_administrative(self): - ba_up_users = self.env['planning.slot'].search([('template_id.planning_name', '=', '计划行政')]) + ba_up_users = self.env['planning.slot'].search([('template_id.planning_name', '=', '保安计划行政')]) for user in ba_up_users: if user.start_datetime.date() == fields.date.today(): self.env['card.remind.form'].create({ @@ -457,8 +457,9 @@ class HrAttendance(models.Model): 'shift': user.template_id.planning_name, 'department': user.department_id.name, }) self.card_in_comment(user.resource_id.employee_id, user.template_id.planning_name) + def card_lc_shift_remind_out_administrative(self): - ba_up_users = self.env['planning.slot'].search([('template_id.planning_name', '=', '计划行政')]) + ba_up_users = self.env['planning.slot'].search([('template_id.planning_name', '=', '保安计划行政')]) for user in ba_up_users: if user.start_datetime.date() == fields.date.today(): self.env['card.remind.form'].create({ @@ -467,6 +468,7 @@ class HrAttendance(models.Model): 'shift': user.template_id.planning_name, 'department': user.department_id.name, }) self.card_out_comment(user.resource_id.employee_id, user.template_id.planning_name) + def card_in_comment(self, employee_id, planning_name): data = f"您的班次是{planning_name},还有10分钟上班,记得打卡" self.sudo().env["wecom.apps"].sync_send_message(category='att', user_id=employee_id.wecom_userid, message=data) diff --git a/yuthon_hr_employee/__manifest__.py b/yuthon_hr_employee/__manifest__.py index 09fddd7d2..b0ac3a5f5 100644 --- a/yuthon_hr_employee/__manifest__.py +++ b/yuthon_hr_employee/__manifest__.py @@ -32,6 +32,8 @@ 'views/inherit_hr_applicant_views.xml', 'views/publish_applicant_setting_views.xml', 'views/inherit_res_groups_views.xml', + 'views/yuthon_medical_rule_views.xml', + 'views/yuthon_medical_manage_views.xml', 'views/yuthon_job_postings_views.xml', 'views/soong_user_role_views.xml', 'wizard/hr_employee_wizard_views.xml', diff --git a/yuthon_hr_employee/models/__init__.py b/yuthon_hr_employee/models/__init__.py index bd14fd10c..917aaf1a5 100644 --- a/yuthon_hr_employee/models/__init__.py +++ b/yuthon_hr_employee/models/__init__.py @@ -11,4 +11,6 @@ from . import yuthon_job_postings from . import yuthon_party_setting from . import inherit_res_groups from . import soong_user_role +from . import yuthon_medical_manage +from . import yuthon_medical_rule diff --git a/yuthon_hr_employee/models/yuthon_medical_manage.py b/yuthon_hr_employee/models/yuthon_medical_manage.py new file mode 100644 index 000000000..cc0c83b34 --- /dev/null +++ b/yuthon_hr_employee/models/yuthon_medical_manage.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models, _ +from odoo.exceptions import UserError, ValidationError +from datetime import datetime +import re + + +class YuthonMedicalManage(models.Model): + _name = 'yuthon.medical.manage' + _description = '体检费管理' + + employee_id = fields.Many2one('hr.employee', string="员工姓名") + current_year_remaining = fields.Float(string="本年剩余") + last_year_quota = fields.Float(string="上年额度") + last_year_balance = fields.Float(string="上年结余") + last_year_used = fields.Float(string="上年使用") + last_year_remaining = fields.Float(string="上年剩余") + prev_last_year_quota = fields.Float(string="前年额度") + prev_last_year_balance = fields.Float(string="前年结余") + prev_last_year_used = fields.Float(string="前年使用") + prev_last_year_remaining = fields.Float(string="前年剩余") diff --git a/yuthon_hr_employee/models/yuthon_medical_rule.py b/yuthon_hr_employee/models/yuthon_medical_rule.py new file mode 100644 index 000000000..086ba3a8f --- /dev/null +++ b/yuthon_hr_employee/models/yuthon_medical_rule.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models, _ +from odoo.exceptions import UserError, ValidationError +from datetime import datetime +import re + + +class YuthonMedicalRule(models.Model): + _name = 'yuthon.medical.rule' + _description = '体检费规则' + + base_amount = fields.Float(string='基数金额') + starting_age = fields.Integer(string='起始年龄') + increase_interval_years = fields.Integer(string='递增间隔(年)') + increment_amount = fields.Float(string='递增金额') + cap = fields.Float(string='封顶金额') + allowance_unmarried_women = fields.Float(string='未婚女性补助') + allowance_married_women = fields.Float(string='已婚女性补助') + start_date = fields.Date(string='开始时间') + end_date = fields.Date(string='结束时间') + is_enable = fields.Boolean(string="是否启用", default=False, compute='compute_is_enable', store=True) + + @api.depends('start_date', 'end_date') + def compute_is_enable(self): + for rec in self: + if rec.start_date and rec.end_date: + if rec.start_date <= fields.Date.today() < rec.end_date: + rec.is_enable = True + else: + rec.is_enable = False \ No newline at end of file diff --git a/yuthon_hr_employee/security/ir.model.access.csv b/yuthon_hr_employee/security/ir.model.access.csv index 0a062b2b0..6640cc757 100644 --- a/yuthon_hr_employee/security/ir.model.access.csv +++ b/yuthon_hr_employee/security/ir.model.access.csv @@ -15,4 +15,6 @@ access_yuthon_job_postings,yuthon_job_postings,model_yuthon_job_postings,base.gr access_interview_message_line,interview_message_line,model_interview_message_line,base.group_user,1,1,1,1 access_yuthon_hr_employee_time_wizard,yuthon_hr_employee_time_wizard,model_yuthon_hr_employee_time_wizard,base.group_user,1,1,1,1 access_hr_job_add_wizard,hr_job_add_wizard,model_hr_job_add_wizard,base.group_user,1,1,1,1 -access_yuthon_party_setting,yuthon_party_setting,model_yuthon_party_setting,base.group_user,1,1,1,1 \ No newline at end of file +access_yuthon_party_setting,yuthon_party_setting,model_yuthon_party_setting,base.group_user,1,1,1,1 +access_yuthon_medical_rule,yuthon_medical_rule,model_yuthon_medical_rule,base.group_user,1,1,1,1 +access_yuthon_medical_manage,yuthon_medical_manage,model_yuthon_medical_manage,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/yuthon_hr_employee/views/inherit_hr_applicant_views.xml b/yuthon_hr_employee/views/inherit_hr_applicant_views.xml index 973cb9f8a..fd43f7c2d 100644 --- a/yuthon_hr_employee/views/inherit_hr_applicant_views.xml +++ b/yuthon_hr_employee/views/inherit_hr_applicant_views.xml @@ -95,4 +95,23 @@ + + 面试信息 + hr.applicant + kanban,tree,form,pivot,graph,calendar,activity + {'search_default_stage':1} + [('stage_id.name','!=',['人才库','待入职'])] + + + 人才库 + hr.applicant + kanban,tree,form,pivot,graph,calendar,activity + [('stage_id.name', '=' , '人才库')] + + + 待入职 + hr.applicant + kanban,tree,form,pivot,graph,calendar,activity + [('stage_id.name', '=', '待入职')] + \ No newline at end of file diff --git a/yuthon_hr_employee/views/yuthon_medical_manage_views.xml b/yuthon_hr_employee/views/yuthon_medical_manage_views.xml new file mode 100644 index 000000000..fecbd88a5 --- /dev/null +++ b/yuthon_hr_employee/views/yuthon_medical_manage_views.xml @@ -0,0 +1,27 @@ + + + + yuthon.medical.manage.tree + yuthon.medical.manage + + + + + + + + + + + + + + + + + 体检费管理 + yuthon.medical.manage + tree + + + diff --git a/yuthon_hr_employee/views/yuthon_medical_rule_views.xml b/yuthon_hr_employee/views/yuthon_medical_rule_views.xml new file mode 100644 index 000000000..0198447a6 --- /dev/null +++ b/yuthon_hr_employee/views/yuthon_medical_rule_views.xml @@ -0,0 +1,26 @@ + + + + yuthon.medical.rule.tree + yuthon.medical.rule + + + + + + + + + + + + + + + + + 体检费规则 + yuthon.medical.rule + tree,form + + \ No newline at end of file diff --git a/yuthon_salary/models/inherit_hr_payroll_structure.py b/yuthon_salary/models/inherit_hr_payroll_structure.py index 0b61fac4b..1ec80a1ba 100644 --- a/yuthon_salary/models/inherit_hr_payroll_structure.py +++ b/yuthon_salary/models/inherit_hr_payroll_structure.py @@ -15,6 +15,60 @@ class HrPayrollStructure(models.Model): end_time = fields.Date(string="失效日期") is_enable = fields.Boolean(string="启用", default=True) + currency_id = fields.Many2one("res.currency", string="货币", required=True, + default=lambda self: self.env.company.currency_id) + rank_salary = fields.Monetary(string="职级工资", currency_field="currency_id") + performance_bonus = fields.Monetary(string="绩效奖金", currency_field="currency_id") + communication_subsidy = fields.Monetary(string="通讯补贴", currency_field="currency_id") + position_salary = fields.Monetary(string="岗位工资", currency_field="currency_id") + seniority_salary = fields.Monetary(string="工龄工资", currency_field="currency_id") + overtime_pay = fields.Monetary(string="加班费", currency_field="currency_id") + full_attendance_bonus = fields.Monetary(string="全勤奖", currency_field="currency_id") + attendance_deduction = fields.Monetary(string="考勤扣款合计", currency_field="currency_id") + assessment_reserve = fields.Monetary(string="考核保留量", currency_field="currency_id") + temporary_performance_salary = fields.Monetary(string="临时绩效工资", currency_field="currency_id") + post_allowance_bonus = fields.Monetary(string="顶岗奖励", currency_field="currency_id") + excellence_performance_bonus = fields.Monetary(string="评优绩效奖金", currency_field="currency_id") + performance_bonus_recovery = fields.Monetary(string="绩效奖金扣回", currency_field="currency_id") + seniority_award = fields.Monetary(string="年功奖", currency_field="currency_id") + special_management_bonus = fields.Monetary(string="经营特别奖", currency_field="currency_id") + annual_leave_settlement = fields.Monetary(string="年假结算", currency_field="currency_id") + assessment_reserve_payment = fields.Monetary(string="考核保留量发放", currency_field="currency_id") + learning_progress_award = fields.Monetary(string="学习进步奖", currency_field="currency_id") + performance_assessment_excellence_bonus = fields.Monetary(string="绩效考核评优奖金", currency_field="currency_id") + prepaid_performance_bonus_recovery = fields.Monetary(string="预发绩效奖金扣回", currency_field="currency_id") + temporary_performance_wages = fields.Monetary(string="临时绩效工资", currency_field="currency_id") + year_end_double_salary = fields.Monetary(string="年终双薪", currency_field="currency_id") + excellence_award_bonus = fields.Monetary(string="评优绩效奖金", currency_field="currency_id") + excellence_bonus = fields.Monetary(string="评优奖金", currency_field="currency_id") + learning_progress_bonus = fields.Monetary(string="学习进步奖", currency_field="currency_id") + social_security_overdeduction_refund = fields.Monetary(string="多扣社保退回", currency_field="currency_id") + performance_bonus_deduction = fields.Monetary(string="绩效奖金扣回", currency_field="currency_id") + communication_subsidy_deduction = fields.Monetary(string="通讯补贴扣回", currency_field="currency_id") + seniority_award_bonus = fields.Monetary(string="年功奖", currency_field="currency_id") + total_budget_salary = fields.Monetary(string="(预算口径)应发工资合计", currency_field="currency_id") + pre_tax_salary = fields.Monetary(string="税前工资合计", currency_field="currency_id") + year_end_bonus = fields.Monetary(string="年终奖金", currency_field="currency_id") + basic_pension = fields.Monetary(string="基本养老", currency_field="currency_id") + basic_medical = fields.Monetary(string="基本医疗", currency_field="currency_id") + unemployment = fields.Monetary(string="失业", currency_field="currency_id") + housing_fund = fields.Monetary(string="公积金", currency_field="currency_id") + personal_contributions_total = fields.Monetary(string="个人缴纳合计", currency_field="currency_id") + child_education = fields.Monetary(string="子女教育", currency_field="currency_id") + elderly_support = fields.Monetary(string="赡养老人", currency_field="currency_id") + housing_loan = fields.Monetary(string="住房贷款", currency_field="currency_id") + housing_rent = fields.Monetary(string="住房租金", currency_field="currency_id") + continuing_education = fields.Monetary(string="继续教育", currency_field="currency_id") + infant_care = fields.Monetary(string="3岁以下婴幼儿照护", currency_field="currency_id") + special_deductions_total = fields.Monetary(string="专项附加扣除小计", currency_field="currency_id") + corporate_annuity = fields.Monetary(string="企业年金", currency_field="currency_id") + payable_salary = fields.Monetary(string="应发工资", currency_field="currency_id") + social_security_funds = fields.Monetary(string="三险一金", currency_field="currency_id") + annuity = fields.Monetary(string="年金", currency_field="currency_id") + tax_adjustment = fields.Monetary(string="应补(退)税额", currency_field="currency_id") + union_fees = fields.Monetary(string="工会会费", currency_field="currency_id") + actual_salary = fields.Monetary(string="实发工资", currency_field="currency_id") + @api.model def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True): res = super(HrPayrollStructure, self).read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, diff --git a/yuthon_salary/views/inherit_hr_payroll_structure_views.xml b/yuthon_salary/views/inherit_hr_payroll_structure_views.xml index 143449b90..31cc55539 100644 --- a/yuthon_salary/views/inherit_hr_payroll_structure_views.xml +++ b/yuthon_salary/views/inherit_hr_payroll_structure_views.xml @@ -21,6 +21,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml index e593940a9..7e7567573 100644 --- a/yuthon_work_brand/views/hr_menus.xml +++ b/yuthon_work_brand/views/hr_menus.xml @@ -21,6 +21,21 @@ parent="hr_recruitment_menu_root_board" action="hr_recruitment.crm_case_categ0_act_job" sequence="2"/> + + + + + sequence="3"/> - + + - + + + + + - + + + + + - + + + + +