From c93144cf172f055e3cc3f43edfbd6119dba44591 Mon Sep 17 00:00:00 2001
From: zhou <123@>
Date: Mon, 21 Apr 2025 15:03:42 +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_salary/models/inherit_hr_payslip.py | 58 +++++++++----------
.../views/inherit_hr_payslip_views.xml | 12 ++--
2 files changed, 35 insertions(+), 35 deletions(-)
diff --git a/yuthon_salary/models/inherit_hr_payslip.py b/yuthon_salary/models/inherit_hr_payslip.py
index f78a0b16f..2895ec456 100644
--- a/yuthon_salary/models/inherit_hr_payslip.py
+++ b/yuthon_salary/models/inherit_hr_payslip.py
@@ -7,18 +7,18 @@ class InheritHrPayslip(models.Model):
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)
+ base_salary = fields.Float(string='基本工资', store=True)
bank_account_id = fields.Many2one(string='银行账号', related='employee_id.bank_account_id', store=True)
tax_payable = fields.Float(string='应补(退)税额', store=True)
actual_salary = fields.Float(string='实发工资', store=True, compute='_compute_actual_salary')
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('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)
+ performance_bonuses = fields.Float(string='预发绩效奖金', store=True)
+ full_attendance_award = fields.Float(string='全勤奖', store=True)
+ commuting_allowance = fields.Float(string='通信补贴', store=True)
position_subsidy = fields.Monetary(string="岗位补贴", compute="_compute_salary", store=True)
- rank_salary = fields.Float(string='职级工资', compute='_compute_salary', store=True)
+ rank_salary = fields.Float(string='职级工资', store=True)
housing_loan_interest = fields.Float(string='累计住房贷款利息')
elderly_support_deduction = fields.Float(string='累计个人养老金')
housing_rent = fields.Float(string='累计住房租金')
@@ -27,28 +27,28 @@ class InheritHrPayslip(models.Model):
continuing_education = fields.Float(string='累计继续教育')
elderly_support = fields.Float(string='累计赡养老人')
infant_care = fields.Float(string='累计3岁以下婴幼儿照护')
- post_salary = fields.Float(string='岗位工资', compute='_compute_salary', store=True)
- seniority_salary = fields.Float(string='工龄工资', compute='_compute_salary', store=True)
- union_dues = fields.Float(string='工会会费', compute='_compute_salary', store=True)
- high_temperature_allowance = fields.Float(string='高温补贴', compute='_compute_salary', store=True)
- overtime_pay = fields.Float(string='加班费', compute='_compute_salary', store=True)
- meal_misunderstanding_fee = fields.Float(string='误餐费', compute='_compute_salary', store=True)
- personal_leave = fields.Float(string='事假', compute='_compute_salary', store=True)
- sick_leave = fields.Float(string='病假', compute='_compute_salary', store=True)
- maternity_leave = fields.Float(string='产假', compute='_compute_salary', store=True)
- marriage_leave = fields.Float(string='婚假', compute='_compute_salary', store=True)
- family_planning_leave = fields.Float(string='计生假', compute='_compute_salary', store=True)
- bereavement_leave = fields.Float(string='丧假', compute='_compute_salary', store=True)
- home_visit_leave = fields.Float(string='探亲假', compute='_compute_salary', store=True)
- hospital_sick_leave = fields.Float(string='住院病假', compute='_compute_salary', store=True)
- exam_leave = fields.Float(string='考试假', compute='_compute_salary', store=True)
- parents_meeting_leave = fields.Float(string='家长会假', compute='_compute_salary', store=True)
- basic_medical_insurance = fields.Float(string='基本医疗保险费', compute='_compute_salary', store=True)
- basic_endowment_insurance = fields.Float(string='基本养老保险费', compute='_compute_salary', store=True)
- unemployment_insurance = fields.Float(string='失业保险费', compute='_compute_salary', store=True)
- work_injury_insurance = fields.Float(string='工伤保险费', compute='_compute_salary', store=True)
- housing_provident_fund = fields.Float(string='住房公积金', compute='_compute_salary', store=True)
- b_year = fields.Float(string='企业(职业)年金', compute='_compute_salary', store=True)
+ post_salary = fields.Float(string='岗位工资', store=True)
+ seniority_salary = fields.Float(string='工龄工资', store=True)
+ union_dues = fields.Float(string='工会会费', store=True)
+ high_temperature_allowance = fields.Float(string='高温补贴', store=True)
+ overtime_pay = fields.Float(string='加班费', store=True)
+ meal_misunderstanding_fee = fields.Float(string='误餐费', store=True)
+ personal_leave = fields.Float(string='事假', store=True)
+ sick_leave = fields.Float(string='病假', store=True)
+ maternity_leave = fields.Float(string='产假', store=True)
+ marriage_leave = fields.Float(string='婚假', store=True)
+ family_planning_leave = fields.Float(string='计生假', store=True)
+ bereavement_leave = fields.Float(string='丧假', store=True)
+ home_visit_leave = fields.Float(string='探亲假', store=True)
+ hospital_sick_leave = fields.Float(string='住院病假', store=True)
+ exam_leave = fields.Float(string='考试假', store=True)
+ parents_meeting_leave = fields.Float(string='家长会假', store=True)
+ basic_medical_insurance = fields.Float(string='基本医疗保险费', store=True)
+ basic_endowment_insurance = fields.Float(string='基本养老保险费', store=True)
+ unemployment_insurance = fields.Float(string='失业保险费', store=True)
+ work_injury_insurance = fields.Float(string='工伤保险费', store=True)
+ housing_provident_fund = fields.Float(string='住房公积金', store=True)
+ b_year = fields.Float(string='企业(职业)年金', store=True)
total_before_tax = fields.Float(string='本期收入', compute='_compute_total_before_tax', store=True)
total_tax = fields.Float(string='本期应收', compute='_compute_total_before_tax', store=True)
year_compute = fields.Float(string='年度清算', store=True)
@@ -91,8 +91,8 @@ class InheritHrPayslip(models.Model):
pay._compute_worked_days_line_ids()
pay.compute_sheet()
- @api.depends('line_ids')
- def _compute_salary(self):
+ @api.constrains('line_ids')
+ def _check_salary(self):
for rec in self:
if rec.line_ids:
for line in rec.line_ids:
diff --git a/yuthon_salary/views/inherit_hr_payslip_views.xml b/yuthon_salary/views/inherit_hr_payslip_views.xml
index d7d236258..2b19f29ed 100644
--- a/yuthon_salary/views/inherit_hr_payslip_views.xml
+++ b/yuthon_salary/views/inherit_hr_payslip_views.xml
@@ -34,12 +34,12 @@
-
-
-
-
-
-
+
+
+
+
+
+