添加功能

This commit is contained in:
李鹏宇
2025-10-16 19:29:19 +08:00
parent 3d6203fb55
commit 59c235fee1
2 changed files with 42 additions and 20 deletions
@@ -23,7 +23,7 @@
<field name="service_fee"/>
<field name="tiantou_payable"/>
<field name="company"/>
<field name="company_id" column_ivisible="1"/>
<field name="company_id" column_invisible="1"/>
</tree>
</field>
</record>
+41 -19
View File
@@ -42,22 +42,44 @@ class PayrollLaborWizard(models.Model):
service_fee = row[14].value
tiantou_payable = row[15].value
company = row[16].value
self.env['yuthon.payroll.labor'].create({
'employee_id': employee_id.id,
'current_year': current_year,
'current_month': current_month,
'basic_salary': basic_salary,
'rank_salary': rank_salary,
'meal_allowance': meal_allowance,
'total_payable': total_payable,
'social_security_personal': social_security_personal,
'provident_fund_personal': provident_fund_personal,
'individual_tax': individual_tax,
'dispatched_actual_salary': dispatched_actual_salary,
'social_security_company': social_security_company,
'provident_fund_company': provident_fund_company,
'disability_insurance': disability_insurance,
'service_fee': service_fee,
'tiantou_payable': tiantou_payable,
'company': company,
})
payroll_id = self.env['yuthon.payroll'].search([('employee_id', '=', employee_id.id),
('current_year', '=', current_year),
('current_month', '=', current_month),
])
if not payroll_id:
self.env['yuthon.payroll.labor'].create({
'employee_id': employee_id.id,
'current_year': current_year,
'current_month': current_month,
'basic_salary': basic_salary,
'rank_salary': rank_salary,
'meal_allowance': meal_allowance,
'total_payable': total_payable,
'social_security_personal': social_security_personal,
'provident_fund_personal': provident_fund_personal,
'individual_tax': individual_tax,
'dispatched_actual_salary': dispatched_actual_salary,
'social_security_company': social_security_company,
'provident_fund_company': provident_fund_company,
'disability_insurance': disability_insurance,
'service_fee': service_fee,
'tiantou_payable': tiantou_payable,
'company': company,
})
else:
payroll_id.write({
'basic_salary': basic_salary,
'rank_salary': rank_salary,
'meal_allowance': meal_allowance,
'total_payable': total_payable,
'social_security_personal': social_security_personal,
'provident_fund_personal': provident_fund_personal,
'individual_tax': individual_tax,
'dispatched_actual_salary': dispatched_actual_salary,
'social_security_company': social_security_company,
'provident_fund_company': provident_fund_company,
'disability_insurance': disability_insurance,
'service_fee': service_fee,
'tiantou_payable': tiantou_payable,
'company': company,
})