From 02b1dbc3d00fd0e69575f7e5fd147641e1585a01 Mon Sep 17 00:00:00 2001
From: zhou <123@>
Date: Mon, 2 Jun 2025 19:31:56 +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
---
.../models/yuthon_vacation_reports.py | 1 +
.../views/yuthon_vacation_reports_views.xml | 1 +
yuthon_property/models/yuthon_property.py | 2 +-
yuthon_salary/__manifest__.py | 1 +
yuthon_salary/models/__init__.py | 3 +-
.../models/inherit_hr_payslip_run.py | 26 ++++++++++++++++
.../views/inherit_hr_payslip_run_views.xml | 18 +++++++++++
yuthon_salary/wizard/salary_compute_wizard.py | 3 +-
.../wizard/salary_compute_wizard_views.xml | 2 +-
yuthon_work_brand/views/hr_menus.xml | 30 +++++++++----------
10 files changed, 68 insertions(+), 19 deletions(-)
create mode 100644 yuthon_salary/models/inherit_hr_payslip_run.py
create mode 100644 yuthon_salary/views/inherit_hr_payslip_run_views.xml
diff --git a/yuthon_holiday/models/yuthon_vacation_reports.py b/yuthon_holiday/models/yuthon_vacation_reports.py
index 7589c8dbd..d88d76c4e 100644
--- a/yuthon_holiday/models/yuthon_vacation_reports.py
+++ b/yuthon_holiday/models/yuthon_vacation_reports.py
@@ -11,6 +11,7 @@ class YuthonVacationReports(models.Model):
employee_id = fields.Many2one('hr.employee', string='员工')
leave = fields.Float(string='年假')
working_overtime = fields.Float(string='加班时')
+ meal_fee = fields.Integer(string="误餐费")
def button_fixes_approval(self):
form_id = self.env.ref('yuthon_holiday.view_yuthon_fixes_approval_form').id
diff --git a/yuthon_holiday/views/yuthon_vacation_reports_views.xml b/yuthon_holiday/views/yuthon_vacation_reports_views.xml
index 609c9be6c..ad0b1e024 100644
--- a/yuthon_holiday/views/yuthon_vacation_reports_views.xml
+++ b/yuthon_holiday/views/yuthon_vacation_reports_views.xml
@@ -8,6 +8,7 @@
+
diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py
index eaa49e798..859446766 100644
--- a/yuthon_property/models/yuthon_property.py
+++ b/yuthon_property/models/yuthon_property.py
@@ -417,7 +417,7 @@ class ManageInformationLine(models.Model):
yuthon_property_id = fields.Many2one('yuthon.property', string="关联物业信息")
purpose_id = fields.Many2one('yuthon.resource.purpose', string="管理类型")
- precinct_id = fields.Many2one('yuthon.precinct.message',string="所属片区")
+ precinct_id = fields.Many2one(related='yuthon_property_id.precinct_id',string="所属片区", readonly=False)
tenure_type = fields.Selection([('self', '自有'), ('agency', '代管')], string='权属类型')
management_area = fields.Float(string="管理面积", digits=(16, 4))
rent_area = fields.Float(string="可租面积", digits=(16, 4))
diff --git a/yuthon_salary/__manifest__.py b/yuthon_salary/__manifest__.py
index f3e374e22..528d5f492 100644
--- a/yuthon_salary/__manifest__.py
+++ b/yuthon_salary/__manifest__.py
@@ -17,6 +17,7 @@
'views/inherit_hr_payroll_structure_views.xml',
'views/inherit_hr_salary_rule_views.xml',
'views/inherit_hr_payslip_views.xml',
+ 'views/inherit_hr_payslip_run_views.xml',
'views/inherit_hr_payroll_structure_type_views.xml',
'views/yuthon_payroll_project_views.xml',
'views/yuthon_payroll_type_setting_views.xml',
diff --git a/yuthon_salary/models/__init__.py b/yuthon_salary/models/__init__.py
index e4b15a246..b715ff945 100644
--- a/yuthon_salary/models/__init__.py
+++ b/yuthon_salary/models/__init__.py
@@ -11,4 +11,5 @@ from . import yuthon_salary_year
from . import yuthon_salary_project
from . import yuthon_salary_asset
from . import salary_payroll_distribution
-from . import yuthon_welfare_expenses
\ No newline at end of file
+from . import yuthon_welfare_expenses
+from . import inherit_hr_payslip_run
\ No newline at end of file
diff --git a/yuthon_salary/models/inherit_hr_payslip_run.py b/yuthon_salary/models/inherit_hr_payslip_run.py
new file mode 100644
index 000000000..c4b295ecf
--- /dev/null
+++ b/yuthon_salary/models/inherit_hr_payslip_run.py
@@ -0,0 +1,26 @@
+from odoo import api, fields, models, _
+from odoo.exceptions import ValidationError, UserError
+import json
+from odoo.tools import date_utils
+import logging
+
+
+class InheritHrPayslipRun(models.Model):
+ _inherit = 'hr.payslip.run'
+
+ document_ids = fields.Many2many('ir.attachment', string="附件")
+
+
+ def Fileline(self):
+ domain = [('is_salary_push', '=', True), ('is_salary_release', '=', True)]
+ return {
+ "name": "薪资归档明细",
+ 'type': 'ir.actions.act_window',
+ 'res_model': 'hr.payslip',
+ "view_mode": "tree",
+ "domain": domain,
+ }
+
+
+ def add_comment(self):
+ pass
diff --git a/yuthon_salary/views/inherit_hr_payslip_run_views.xml b/yuthon_salary/views/inherit_hr_payslip_run_views.xml
new file mode 100644
index 000000000..98ec20160
--- /dev/null
+++ b/yuthon_salary/views/inherit_hr_payslip_run_views.xml
@@ -0,0 +1,18 @@
+
+
+
+ hr.payroll.run.inherit
+ hr.payslip.run
+
+
+
+ bottom
+
+
+
+
+
+
+
+
+
diff --git a/yuthon_salary/wizard/salary_compute_wizard.py b/yuthon_salary/wizard/salary_compute_wizard.py
index e39ea000b..ae7b3aa3a 100644
--- a/yuthon_salary/wizard/salary_compute_wizard.py
+++ b/yuthon_salary/wizard/salary_compute_wizard.py
@@ -37,13 +37,14 @@ class SalaryComputeWizard(models.Model):
('contract_id.state', '!=', 'cancel'),
('contract_id', '!=', False),
])
+ self.employee_number = len(self.employee_ids)
self.employee_ids = [(6, 0, employees.ids)]
@api.onchange('employee_ids')
def onchange_employee_ids(self):
if self.employee_ids:
- employee_number = len(self.employee_ids)
+ self.employee_ids = len(self.employee_ids)
def confirm(self):
attendance_records = self.env['hr.attendance.month'].search([
diff --git a/yuthon_salary/wizard/salary_compute_wizard_views.xml b/yuthon_salary/wizard/salary_compute_wizard_views.xml
index 048d717bb..3acde7a57 100644
--- a/yuthon_salary/wizard/salary_compute_wizard_views.xml
+++ b/yuthon_salary/wizard/salary_compute_wizard_views.xml
@@ -8,7 +8,7 @@
-
+
diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml
index afe48d394..834796663 100644
--- a/yuthon_work_brand/views/hr_menus.xml
+++ b/yuthon_work_brand/views/hr_menus.xml
@@ -262,6 +262,11 @@
name="薪资审定"
parent="human_resources_salary_root_board"
sequence="6"/>
+
-
-
+
+
+
+
+
+
+
+
+
+
@@ -335,11 +340,6 @@
parent="human_pay_setting_work_setting"
action="yuthon_salary.yuthon_payroll_type_setting_action"
sequence="5"/>
-