diff --git a/yuthon_salary/wizard/salary_compute_wizard.py b/yuthon_salary/wizard/salary_compute_wizard.py index 7a01cb069..391733848 100644 --- a/yuthon_salary/wizard/salary_compute_wizard.py +++ b/yuthon_salary/wizard/salary_compute_wizard.py @@ -96,17 +96,17 @@ class SalaryComputeWizard(models.Model): 'state': 'draft', 'payslip_count': 0 }) - existing_payslip = self.env['hr.payslip'].search([ - ('is_push', '=', False), - ('employee_id', '=', employee.id), - ('date_from', '<=', end_date), - ('date_to', '>=', start_date) - ]) - employee.salary_date = start_date - employee.salary_month = self.select_time - employee.salary_year_jin_ids = [(6, 0, self.employee_ids.ids)] - if existing_payslip: - raise UserError(f"员工 {employee.name} 在 {start_date} 到 {end_date} 日期范围内已有工资单记录,无法创建新的工资单。") + # existing_payslip = self.env['hr.payslip'].search([ + # ('is_push', '=', False), + # ('employee_id', '=', employee.id), + # ('date_from', '<=', end_date), + # ('date_to', '>=', start_date) + # ]) + # employee.salary_date = start_date + # employee.salary_month = self.select_time + # employee.salary_year_jin_ids = [(6, 0, self.employee_ids.ids)] + # if existing_payslip: + # raise UserError(f"员工 {employee.name} 在 {start_date} 到 {end_date} 日期范围内已有工资单记录,无法创建新的工资单。") # 查找有效合同:date_start <= start_date <= date_end(或date_end为空) contract_id = self.env['hr.contract'].search([