From acb2b8317bc990dcba460ee770183c1b1c4b9f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Tue, 6 Jan 2026 21:04:16 +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/models/yuthon_meal_expenses.py | 4 ++-- yuthon_salary/wizard/party_meal_wizard.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/yuthon_salary/models/yuthon_meal_expenses.py b/yuthon_salary/models/yuthon_meal_expenses.py index e0b571b42..97533db70 100644 --- a/yuthon_salary/models/yuthon_meal_expenses.py +++ b/yuthon_salary/models/yuthon_meal_expenses.py @@ -28,8 +28,8 @@ class YuthonMealExpenses(models.Model): return str(current_month) def send_meal(self): - year = self.select_year or datetime.now().year - month = self.select_time or datetime.now().month + year = int(self.select_year) + month = int(self.select_time) last_day = calendar.monthrange(year, month)[1] message = f"""致{self.employee_id.name}: {self.select_year}年{self.select_time}月 早餐{self.number_breakfasts} 次、午餐{self.number_lunches} 次,按餐标核算, diff --git a/yuthon_salary/wizard/party_meal_wizard.py b/yuthon_salary/wizard/party_meal_wizard.py index e82353782..1312eef81 100644 --- a/yuthon_salary/wizard/party_meal_wizard.py +++ b/yuthon_salary/wizard/party_meal_wizard.py @@ -33,8 +33,8 @@ class PartyMealWizard(models.TransientModel): employee_ids = fields.Many2many('hr.employee', string='员工') def confirm(self): - year = self.select_year or datetime.now().year - month = self.select_time or datetime.now().month + year = int(self.select_year) + month = int(self.select_time) last_day = calendar.monthrange(year, month)[1] if self.select_time and self.select_year and not self.employee_ids: meal_ids = self.env['yuthon.meal.expenses'].search([('select_time', '=', self.select_time),