From 7287e0af3e9a057414e3964fcb5dceed90a7894d Mon Sep 17 00:00:00 2001
From: zhou <123@>
Date: Thu, 3 Apr 2025 15:29:59 +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_contract/__manifest__.py | 1 +
yuthon_contract/models/inherit_hr_contract.py | 10 +++++++++-
yuthon_contract/security/company_rule.xml | 8 ++++++++
yuthon_hr_employee/models/yuthon_hr_employee.py | 1 +
yuthon_hr_employee/views/yuthon_hr_employee_views.xml | 6 ++++++
yuthon_salary/models/inherit_hr_payslip.py | 5 +++--
yuthon_salary/models/yuthon_payroll_project.py | 2 +-
.../views/inherit_hr_payroll_structure_views.xml | 2 +-
yuthon_salary/views/inherit_hr_payslip_views.xml | 10 ++++++++++
yuthon_salary/views/yuthon_payroll_labor_views.xml | 2 +-
yuthon_salary/views/yuthon_payroll_project_views.xml | 6 +++---
yuthon_salary/views/yuthon_payroll_retired_views.xml | 2 +-
12 files changed, 45 insertions(+), 10 deletions(-)
create mode 100644 yuthon_contract/security/company_rule.xml
diff --git a/yuthon_contract/__manifest__.py b/yuthon_contract/__manifest__.py
index 97b6fabdc..1109b7174 100644
--- a/yuthon_contract/__manifest__.py
+++ b/yuthon_contract/__manifest__.py
@@ -13,6 +13,7 @@
'depends': ['hr_contract', 'yuthon_hr_employee', 'base', 'yuthon_salary'],
'data': [
'security/ir.model.access.csv',
+ 'security/company_rule.xml',
'data/contract_code_data.xml',
'wizard/yuthon_contract_wizard_views.xml',
# 'views/inherit_hr_contract_views.xml',
diff --git a/yuthon_contract/models/inherit_hr_contract.py b/yuthon_contract/models/inherit_hr_contract.py
index 4368321c8..f34f65352 100644
--- a/yuthon_contract/models/inherit_hr_contract.py
+++ b/yuthon_contract/models/inherit_hr_contract.py
@@ -12,7 +12,7 @@ class HrContract(models.Model):
name = fields.Char(string="合同名称", compute='_compute_name', readonly=False)
resource_calendar_id = fields.Many2one('resource.calendar', string='考勤时间表')
date_of_entry = fields.Date(related='employee_id.entry_date', string="入职时间")
- salary_group_id = fields.Many2one(related='employee_id.salary_group_id', string="工资单分组", store=True, index=True)
+ salary_group_id = fields.Many2one('yuthon.salary.group', string="工资单分组", store=True, index=True)
work_entry_source = fields.Selection([
('calendar', '考勤安排'),
@@ -46,3 +46,11 @@ class HrContract(models.Model):
"view_mode": "form",
"target": "new",
}
+
+ def update_contract(self):
+ contract_ids = self.env["hr.contract"].browse(
+ self._context.get('active_ids', self._context.get('active_id')))
+ for contract in contract_ids:
+ company_id = contract.employee_id.company_id
+ contract.write({
+ 'company_id':company_id.id})
diff --git a/yuthon_contract/security/company_rule.xml b/yuthon_contract/security/company_rule.xml
new file mode 100644
index 000000000..6df160813
--- /dev/null
+++ b/yuthon_contract/security/company_rule.xml
@@ -0,0 +1,8 @@
+
+
+
+ 合同多公司
+
+ [('company_id', 'in', company_ids)]
+
+
\ No newline at end of file
diff --git a/yuthon_hr_employee/models/yuthon_hr_employee.py b/yuthon_hr_employee/models/yuthon_hr_employee.py
index 64cb416ee..7bdb7b7a9 100644
--- a/yuthon_hr_employee/models/yuthon_hr_employee.py
+++ b/yuthon_hr_employee/models/yuthon_hr_employee.py
@@ -62,6 +62,7 @@ class YuthonHrEmployee(models.Model):
user_origin = fields.Char(string="籍贯")
user_location = fields.Char(string="户口所在地")
is_location = fields.Boolean(string="是否本地")
+ bank_account = fields.Char(string="银行卡号")
user_location_type = fields.Selection([('formal', '本地农业'), ('labor', '本地非农业'),
('part_time', '外地农业'), ('practice', '外地非农业')], string="户籍类型")
duty_replacement_card = fields.Integer(string="值班补卡次数(月)")
diff --git a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml
index 2b60fb651..bb31d5b2e 100644
--- a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml
+++ b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml
@@ -21,6 +21,12 @@
+
+ 1
+
+
+
+
diff --git a/yuthon_salary/models/inherit_hr_payslip.py b/yuthon_salary/models/inherit_hr_payslip.py
index cf7479a80..f3c80eb6a 100644
--- a/yuthon_salary/models/inherit_hr_payslip.py
+++ b/yuthon_salary/models/inherit_hr_payslip.py
@@ -5,12 +5,13 @@ from odoo.exceptions import ValidationError, UserError
class InheritHrPayslip(models.Model):
_inherit = 'hr.payslip'
- company_id = fields.Many2one(related='employee_id.company_id', string="公司")
+ company_id = fields.Many2one('res.company', string="公司", default=lambda self: self.env.company)
employee_id = fields.Many2one('hr.employee', string="姓名")
base_salary = fields.Float(string='基本工资', compute='_compute_salary', store=True)
+ bank_account = fields.Char(string='银行账号', related='employee_id.bank_account', store=True)
identification_id = fields.Char(string='证件号码', related='employee_id.identification_id', store=True)
card_type = fields.Char(string='证件类型', store=True, default="居民身份证")
- salary_group_id = fields.Many2one(related='employee_id.salary_group_id', string="工资组", store=True, index=True)
+ salary_group_id = fields.Many2one('yuthon.salary.group', string="工资组", store=True, index=True)
performance_bonuses = fields.Float(string='预发绩效奖金', compute='_compute_salary', store=True)
full_attendance_award = fields.Float(string='全勤奖', compute='_compute_salary', store=True)
commuting_allowance = fields.Float(string='通信补贴', compute='_compute_salary', store=True)
diff --git a/yuthon_salary/models/yuthon_payroll_project.py b/yuthon_salary/models/yuthon_payroll_project.py
index 8b4b86419..8b657b3c1 100644
--- a/yuthon_salary/models/yuthon_payroll_project.py
+++ b/yuthon_salary/models/yuthon_payroll_project.py
@@ -10,7 +10,7 @@ class YuthonPayrollCommon(models.Model):
_order = 'sequence asc'
yuthon_company = fields.Selection([('thtz', 'thtz')], default="thtz")
- company_id = fields.Many2one('res.company', string="公司")
+ company_id = fields.Many2one('res.company', string="公司", default=lambda self: self.env.company)
name = fields.Char(string='工资项名称')
sequence = fields.Char(string='序号', store=True)
department_id = fields.Many2one('hr.department', string="部门")
diff --git a/yuthon_salary/views/inherit_hr_payroll_structure_views.xml b/yuthon_salary/views/inherit_hr_payroll_structure_views.xml
index 12902265a..f3c399559 100644
--- a/yuthon_salary/views/inherit_hr_payroll_structure_views.xml
+++ b/yuthon_salary/views/inherit_hr_payroll_structure_views.xml
@@ -22,7 +22,7 @@
-
+
diff --git a/yuthon_salary/views/inherit_hr_payslip_views.xml b/yuthon_salary/views/inherit_hr_payslip_views.xml
index 4e1a0fc76..3ab3fe670 100644
--- a/yuthon_salary/views/inherit_hr_payslip_views.xml
+++ b/yuthon_salary/views/inherit_hr_payslip_views.xml
@@ -262,6 +262,16 @@
+
+ inherit.view.hr.payslip.tree
+ hr.payslip
+
+
+
+
+
+
+
薪资审定
hr.payslip
diff --git a/yuthon_salary/views/yuthon_payroll_labor_views.xml b/yuthon_salary/views/yuthon_payroll_labor_views.xml
index b382a3bca..46fcc3d75 100644
--- a/yuthon_salary/views/yuthon_payroll_labor_views.xml
+++ b/yuthon_salary/views/yuthon_payroll_labor_views.xml
@@ -8,7 +8,7 @@
-
+
diff --git a/yuthon_salary/views/yuthon_payroll_project_views.xml b/yuthon_salary/views/yuthon_payroll_project_views.xml
index 9d10e1641..0e55ebc8b 100644
--- a/yuthon_salary/views/yuthon_payroll_project_views.xml
+++ b/yuthon_salary/views/yuthon_payroll_project_views.xml
@@ -7,7 +7,7 @@
-
+
@@ -38,7 +38,7 @@
-
+
@@ -58,7 +58,7 @@
-
+
diff --git a/yuthon_salary/views/yuthon_payroll_retired_views.xml b/yuthon_salary/views/yuthon_payroll_retired_views.xml
index 6e9605bbc..319db32ba 100644
--- a/yuthon_salary/views/yuthon_payroll_retired_views.xml
+++ b/yuthon_salary/views/yuthon_payroll_retired_views.xml
@@ -8,7 +8,7 @@
-
+