!3262 添加功能

Merge pull request !3262 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2025-06-12 06:47:52 +00:00
committed by Gitee
3 changed files with 7 additions and 2 deletions
@@ -152,6 +152,10 @@ class InheritHrPayslip(models.Model):
self.env['hr.payslip.line'].create(payslips._get_payslip_lines())
return True
@api.onchange('employee_id')
def _onchange_salary_group_id(self):
self.salary_group_id = self.employee_id.contract_id.salary_group_id
@api.depends('line_ids', 'social_security')
def _compute_salary(self):
for rec in self:
@@ -224,14 +224,14 @@ class YuthonPayrollInsurances (models.Model):
formula_salary = "result = employee.social_base_on * " + str(number)
if ins.name == '住房公积金':
code = 'ZFGJJ'
formula_salary = "result = 0.0 if employee.total_coefficients == 0 else round((employee.converted/employee.total_coefficients * employee.conversion_factor * 0.08 * 0.5)/12, 2)"
formula_salary = "result = (round((employee.housing_fund_base * " + str(number) + "), 0)) if employee.is_accum_salary else 0"
if ins.name == '工会会费':
code = 'GHHF'
formula_salary = "result = round((payslip.base_salary * 0.005), 2)"
if ins.name == '企业(职业)年金':
if ins.company_id.name == '天河物管':
code = 'WGQYNJ'
formula_salary = "result = round((employee.converted/(employee.total_coefficients * employee.conversion_factor * 0.08 * 0.5))/12, 2)"
formula_salary = "result = 0.0 if employee.total_coefficients == 0 else round((employee.converted/employee.total_coefficients * employee.calculation_totals * 0.08 * 0.5)/12, 2)"
else:
code = 'QYNJ'
formula_salary = "result = round((employee.last_year_salary * 0.02), 0)"
@@ -117,6 +117,7 @@
<field name="arch" type="xml">
<xpath expr="//field[@name='company_id']" position="after">
<field name="base_salary" invisible="1" required="0"/>
<field name="salary_group_id"/>
<field name="performance_bonuses" invisible="1" required="0"/>
<field name="full_attendance_award" invisible="1"/>
<field name="commuting_allowance" invisible="1" required="0"/>