添加功能

This commit is contained in:
zhou
2025-06-12 14:46:39 +08:00
parent 335c279c2b
commit 853808de1b
3 changed files with 6 additions and 1 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:
@@ -231,7 +231,7 @@ class YuthonPayrollInsurances (models.Model):
if ins.name == '企业(职业)年金':
if ins.company_id.name == '天河物管':
code = 'WGQYNJ'
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 = 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"/>