From 77d4caaeb18010bcd0075fc7578f32495b0074b5 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Fri, 13 Jun 2025 10:16:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_salary/wizard/salary_compute_wizard.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/yuthon_salary/wizard/salary_compute_wizard.py b/yuthon_salary/wizard/salary_compute_wizard.py index 01f5a1b85..e89d301aa 100644 --- a/yuthon_salary/wizard/salary_compute_wizard.py +++ b/yuthon_salary/wizard/salary_compute_wizard.py @@ -84,8 +84,8 @@ class SalaryComputeWizard(models.Model): ('date_from', '<=', end_date), ('date_to', '>=', start_date) ]) - if existing_payslip: - raise UserError(f"员工 {employee.name} 在 {start_date} 到 {end_date} 日期范围内已有工资单记录,无法创建新的工资单。") + # if existing_payslip: + # raise UserError(f"员工 {employee.name} 在 {start_date} 到 {end_date} 日期范围内已有工资单记录,无法创建新的工资单。") self.env['hr.payslip'].create({ 'is_bold': is_bold, 'name': employee.name, @@ -185,11 +185,12 @@ class SalaryComputeWizard(models.Model): setattr(internship_id, field_name, result) line.write({'total': result}) - for rec in self.env['hr.payslip'].search([('is_push', '=', False)]): - rec.compute_sheet() + # for rec in self.env['hr.payslip'].search([('is_push', '=', False)]): + # rec.compute_sheet() for rec2 in self.env['hr.payslip'].search([('employee_id.name', 'in', ['黄昱皓', '谭铭浩', '朱文浩'])]): rec2.compute_sheet() + def _get_chinese_month(self, month): chinese_months = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'] return chinese_months[month - 1]