Merge pull request !2531 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2025-04-21 07:04:38 +00:00
committed by Gitee
2 changed files with 35 additions and 35 deletions
+29 -29
View File
@@ -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:
@@ -34,12 +34,12 @@
<field name="struct_id" string="职级"/>
<field name="bank_account_id"/>
<field name="actual_salary" decoration-danger="1"/>
<field name="base_salary"/>
<field name="rank_salary"/>
<field name="post_salary"/>
<field name="performance_bonuses"/>
<field name="commuting_allowance"/>
<field name="seniority_salary"/>
<field name="base_salary" required="1"/>
<field name="rank_salary" required="1"/>
<field name="post_salary" required="1"/>
<field name="performance_bonuses" required="1"/>
<field name="commuting_allowance" required="1"/>
<field name="seniority_salary" required="1"/>
<field name="full_attendance_award"/>
<field name="overtime_pay"/>
<field name="high_temperature_allowance"/>