1
This commit is contained in:
@@ -55,20 +55,18 @@ class TemporaryPayslipWizard(models.Model):
|
||||
("employee_id", "=", employee_id.id),
|
||||
('is_push', '=', False),
|
||||
])
|
||||
|
||||
|
||||
line_vals = {}
|
||||
for col_idx in range(1, len(headers)):
|
||||
header = headers[col_idx]
|
||||
temporary_id = self.env['yuthon.payroll.temporary'].search([('name', '=', header)]) # 查找临时项
|
||||
if not payslip.line_ids.search([('name', '=', header)]) or not temporary_id:
|
||||
raise ValidationError(f'未识别到存在工资项,请检查是否有该项目和格式名称是否对应\n员工: {employee_id.name}\n批次: {self.select_year}'
|
||||
raise ValidationError(f'未识别到存在工资项,请检查是否有该项目和格式名称是否对应\n'
|
||||
f'员工: {employee_id.name}\n批次: {self.select_year}'
|
||||
f'年-{month_name}\n薪资结构: {payslip.struct_id.name}\n导入工资项名称: {header}')
|
||||
cell_value = row[col_idx].value
|
||||
if cell_value in (None, "", " "):
|
||||
continue
|
||||
for line in payslip.line_ids.search([('name', '=', header),
|
||||
('employee_id', '=', employee_id.id),
|
||||
for line in payslip.line_ids.search([('name', '=', header), ('employee_id', '=', employee_id.id),
|
||||
('slip_id.payslip_run_id.name', '=', f'{self.select_year}年-{month_name}')]):
|
||||
line_vals[line.id] = {"total": float(cell_value)}
|
||||
if line_vals:
|
||||
|
||||
Reference in New Issue
Block a user