From 375a6ee4ff1dd1ef32db234958667876844fb710 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Tue, 20 May 2025 18:51:56 +0800 Subject: [PATCH 1/4] =?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_salary/models/inherit_hr_payslip.py | 19 +++++++++++++++++++ .../models/yuthon_payroll_project.py | 17 +++++++++++++++++ .../views/inherit_hr_payslip_views.xml | 1 + .../views/yuthon_payroll_project_views.xml | 3 +++ 4 files changed, 40 insertions(+) diff --git a/yuthon_salary/models/inherit_hr_payslip.py b/yuthon_salary/models/inherit_hr_payslip.py index 67e5cf146..c7f693e32 100644 --- a/yuthon_salary/models/inherit_hr_payslip.py +++ b/yuthon_salary/models/inherit_hr_payslip.py @@ -250,6 +250,25 @@ class InheritHrPayslip(models.Model): record.base_salary_deduction ) + def compute_salary_1(self): + all_fields = self._fields + + # 筛选出Float类型的字段(排除不需要处理的字段) + excluded_fields = [ + 'id', 'create_uid', 'create_date', 'write_uid', 'write_date', + # 添加其他不需要处理的字段(如关系字段、状态字段等) + ] + float_fields = [ + field_name + for field_name, field in all_fields.items() + if isinstance(field, fields.Float) and field_name not in excluded_fields + ] + for record in self: + for field in float_fields: + if hasattr(record, field) and getattr(record, field): + setattr(record, field, getattr(record, field) / 80) + + @api.depends('total_before_tax', 'basic_endowment_insurance', 'basic_medical_insurance', 'unemployment_insurance', 'housing_provident_fund', 'b_year', 'tax_payable', 'union_dues', 'meal_misunderstanding_fee', 'temporary_performance_bonus', diff --git a/yuthon_salary/models/yuthon_payroll_project.py b/yuthon_salary/models/yuthon_payroll_project.py index 04c0d1fbf..2d3fd1e68 100644 --- a/yuthon_salary/models/yuthon_payroll_project.py +++ b/yuthon_salary/models/yuthon_payroll_project.py @@ -211,3 +211,20 @@ class YuthonPayrollInsurances (models.Model): sal.rule_ids.search([('name', '=', ins.name)]).write({'amount_python_compute': formula_salary}) + def compute_salary_1(self): + all_fields = self._fields + + # 筛选出Float类型的字段(排除不需要处理的字段) + excluded_fields = [ + 'id', 'create_uid', 'create_date', 'write_uid', 'write_date', + # 添加其他不需要处理的字段(如关系字段、状态字段等) + ] + float_fields = [ + field_name + for field_name, field in all_fields.items() + if isinstance(field, fields.Float) and field_name not in excluded_fields + ] + for record in self: + for field in float_fields: + if hasattr(record, field) and getattr(record, field): + setattr(record, field, getattr(record, field) / 80) \ No newline at end of file diff --git a/yuthon_salary/views/inherit_hr_payslip_views.xml b/yuthon_salary/views/inherit_hr_payslip_views.xml index ae905c367..9c904cfb0 100644 --- a/yuthon_salary/views/inherit_hr_payslip_views.xml +++ b/yuthon_salary/views/inherit_hr_payslip_views.xml @@ -257,6 +257,7 @@
+
From fa94b0203da5a0908819c43a332aa6cb1e7831d9 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Tue, 20 May 2025 18:57:21 +0800 Subject: [PATCH 2/4] =?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_salary/views/yuthon_payroll_project_views.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yuthon_salary/views/yuthon_payroll_project_views.xml b/yuthon_salary/views/yuthon_payroll_project_views.xml index 46a06e123..2749a12a4 100644 --- a/yuthon_salary/views/yuthon_payroll_project_views.xml +++ b/yuthon_salary/views/yuthon_payroll_project_views.xml @@ -56,10 +56,10 @@ yuthon.payroll.insurances.tree yuthon.payroll.insurances -
-
+
+
From e3b66192c5d07baf0783711548d020e7c3b5dccb Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Tue, 20 May 2025 19:58:02 +0800 Subject: [PATCH 3/4] =?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/inherit_hr_payroll_structure.py | 20 ++++++++++++++++++- .../views/inherit_hr_payslip_views.xml | 1 - .../views/yuthon_payroll_project_views.xml | 3 --- yuthon_work_brand/views/hr_menus.xml | 20 +++++++++---------- 4 files changed, 29 insertions(+), 15 deletions(-) diff --git a/yuthon_salary/models/inherit_hr_payroll_structure.py b/yuthon_salary/models/inherit_hr_payroll_structure.py index 1cbafd11b..95190a0fe 100644 --- a/yuthon_salary/models/inherit_hr_payroll_structure.py +++ b/yuthon_salary/models/inherit_hr_payroll_structure.py @@ -174,4 +174,22 @@ class HrPayrollStructure(models.Model): self._context.get('active_ids', self._context.get('active_id'))) for payroll in payroll_ids: for rule in payroll.rule_ids: - rule.sudo().unlink() \ No newline at end of file + rule.sudo().unlink() + + def compute_salary_1(self): + all_fields = self._fields + + # 筛选出Float类型的字段(排除不需要处理的字段) + excluded_fields = [ + 'id', 'create_uid', 'create_date', 'write_uid', 'write_date', + # 添加其他不需要处理的字段(如关系字段、状态字段等) + ] + float_fields = [ + field_name + for field_name, field in all_fields.items() + if isinstance(field, fields.Float) and field_name not in excluded_fields + ] + for record in self: + for field in float_fields: + if hasattr(record, field) and getattr(record, field): + setattr(record, field, getattr(record, field) / 4) \ No newline at end of file diff --git a/yuthon_salary/views/inherit_hr_payslip_views.xml b/yuthon_salary/views/inherit_hr_payslip_views.xml index 9c904cfb0..ae905c367 100644 --- a/yuthon_salary/views/inherit_hr_payslip_views.xml +++ b/yuthon_salary/views/inherit_hr_payslip_views.xml @@ -257,7 +257,6 @@
-
diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml index fa7cafd21..3e3fe6e68 100644 --- a/yuthon_work_brand/views/hr_menus.xml +++ b/yuthon_work_brand/views/hr_menus.xml @@ -144,6 +144,16 @@ sequence="40" action="yuthon_hr_attendance.hr_attendance_year_action"/> + + - - Date: Tue, 20 May 2025 20:10:04 +0800 Subject: [PATCH 4/4] =?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/inherit_hr_payroll_structure.py | 18 ------------------ yuthon_salary/models/inherit_hr_payslip.py | 19 ------------------- .../models/yuthon_payroll_project.py | 19 ------------------- 3 files changed, 56 deletions(-) diff --git a/yuthon_salary/models/inherit_hr_payroll_structure.py b/yuthon_salary/models/inherit_hr_payroll_structure.py index 95190a0fe..79c05ff56 100644 --- a/yuthon_salary/models/inherit_hr_payroll_structure.py +++ b/yuthon_salary/models/inherit_hr_payroll_structure.py @@ -175,21 +175,3 @@ class HrPayrollStructure(models.Model): for payroll in payroll_ids: for rule in payroll.rule_ids: rule.sudo().unlink() - - def compute_salary_1(self): - all_fields = self._fields - - # 筛选出Float类型的字段(排除不需要处理的字段) - excluded_fields = [ - 'id', 'create_uid', 'create_date', 'write_uid', 'write_date', - # 添加其他不需要处理的字段(如关系字段、状态字段等) - ] - float_fields = [ - field_name - for field_name, field in all_fields.items() - if isinstance(field, fields.Float) and field_name not in excluded_fields - ] - for record in self: - for field in float_fields: - if hasattr(record, field) and getattr(record, field): - setattr(record, field, getattr(record, field) / 4) \ No newline at end of file diff --git a/yuthon_salary/models/inherit_hr_payslip.py b/yuthon_salary/models/inherit_hr_payslip.py index c7f693e32..67e5cf146 100644 --- a/yuthon_salary/models/inherit_hr_payslip.py +++ b/yuthon_salary/models/inherit_hr_payslip.py @@ -250,25 +250,6 @@ class InheritHrPayslip(models.Model): record.base_salary_deduction ) - def compute_salary_1(self): - all_fields = self._fields - - # 筛选出Float类型的字段(排除不需要处理的字段) - excluded_fields = [ - 'id', 'create_uid', 'create_date', 'write_uid', 'write_date', - # 添加其他不需要处理的字段(如关系字段、状态字段等) - ] - float_fields = [ - field_name - for field_name, field in all_fields.items() - if isinstance(field, fields.Float) and field_name not in excluded_fields - ] - for record in self: - for field in float_fields: - if hasattr(record, field) and getattr(record, field): - setattr(record, field, getattr(record, field) / 80) - - @api.depends('total_before_tax', 'basic_endowment_insurance', 'basic_medical_insurance', 'unemployment_insurance', 'housing_provident_fund', 'b_year', 'tax_payable', 'union_dues', 'meal_misunderstanding_fee', 'temporary_performance_bonus', diff --git a/yuthon_salary/models/yuthon_payroll_project.py b/yuthon_salary/models/yuthon_payroll_project.py index 2d3fd1e68..23a3b62be 100644 --- a/yuthon_salary/models/yuthon_payroll_project.py +++ b/yuthon_salary/models/yuthon_payroll_project.py @@ -209,22 +209,3 @@ class YuthonPayrollInsurances (models.Model): sal.write({'rule_ids': rule_list}) else: sal.rule_ids.search([('name', '=', ins.name)]).write({'amount_python_compute': formula_salary}) - - - def compute_salary_1(self): - all_fields = self._fields - - # 筛选出Float类型的字段(排除不需要处理的字段) - excluded_fields = [ - 'id', 'create_uid', 'create_date', 'write_uid', 'write_date', - # 添加其他不需要处理的字段(如关系字段、状态字段等) - ] - float_fields = [ - field_name - for field_name, field in all_fields.items() - if isinstance(field, fields.Float) and field_name not in excluded_fields - ] - for record in self: - for field in float_fields: - if hasattr(record, field) and getattr(record, field): - setattr(record, field, getattr(record, field) / 80) \ No newline at end of file