From b46bb9252cefc37ba70fe02fdf581495a44482e1 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: Wed, 4 Mar 2026 16:34:35 +0800 Subject: [PATCH 1/4] =?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_hr_attendance/models/yuthon_vacation_reports.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index c6e778667..92509aeae 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -189,8 +189,8 @@ class YuthonVacationReports(models.Model): @api.model def meal_line(self): today = date.today() - start_date = date(today.year, today.month, 1) - next_month = today.month + 1 if today.month < 12 else 1 + start_date = date(today.year, today.month - 1, 1) + next_month = today.month if today.month < 12 else 1 next_year = today.year if today.month < 12 else today.year + 1 end_date = date(next_year, next_month, 1) - timedelta(days=1) return { @@ -201,7 +201,8 @@ class YuthonVacationReports(models.Model): 'domain': [ ('vacation_date', '>=', start_date), ('vacation_date', '<=', end_date), - ('company_id', 'in', self.env.companies.ids) + ('company_id', 'in', self.env.companies.ids), + ('text', '!=', '上月额度继承') ], 'target': 'current', 'context': {'tree_view_ref': "yuthon_hr_attendance.view_vacation_meal_line_tree"} From bd959d016ca1a76b1f1532bf80552ca4bce55c0c 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: Wed, 4 Mar 2026 16:38:25 +0800 Subject: [PATCH 2/4] =?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_hr_attendance/models/yuthon_vacation_reports.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 92509aeae..fb8729bc4 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -199,7 +199,7 @@ class YuthonVacationReports(models.Model): "views": [(False, "tree")], 'res_model': 'vacation.meal.line', 'domain': [ - ('vacation_date', '>=', start_date), + ('update_type', '>=', 'add'), ('vacation_date', '<=', end_date), ('company_id', 'in', self.env.companies.ids), ('text', '!=', '上月额度继承') From 7714a4757a618fead3c0c0c10f6afe1871972469 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: Wed, 4 Mar 2026 17:08:03 +0800 Subject: [PATCH 3/4] =?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_hr_attendance/models/yuthon_vacation_reports.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index fb8729bc4..6fe091fe2 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -189,16 +189,22 @@ class YuthonVacationReports(models.Model): @api.model def meal_line(self): today = date.today() - start_date = date(today.year, today.month - 1, 1) + next_month = today.month if today.month < 12 else 1 next_year = today.year if today.month < 12 else today.year + 1 end_date = date(next_year, next_month, 1) - timedelta(days=1) + active_records = self.env['vacation.meal.active'].search([('select_revoke', '=', 'to_do')]) + line_ids = [rec.line_id.id for rec in active_records if rec.line_id] return { 'type': 'ir.actions.act_window', 'name': '误餐情况', "views": [(False, "tree")], 'res_model': 'vacation.meal.line', 'domain': [ + ('meal', '=', 'yes'), + ('vacation_id', '!=', False), + ('workflow_id', '!=', False), + ('id', 'not in', line_ids), ('update_type', '>=', 'add'), ('vacation_date', '<=', end_date), ('company_id', 'in', self.env.companies.ids), From 0ed6d203be567021452c7b9e8b1ff4e4a7a54b0e 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: Wed, 4 Mar 2026 17:25:04 +0800 Subject: [PATCH 4/4] =?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_hr_attendance/models/yuthon_vacation_reports.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 6fe091fe2..9f6c7bd5d 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -189,7 +189,6 @@ class YuthonVacationReports(models.Model): @api.model def meal_line(self): today = date.today() - next_month = today.month if today.month < 12 else 1 next_year = today.year if today.month < 12 else today.year + 1 end_date = date(next_year, next_month, 1) - timedelta(days=1) @@ -1271,6 +1270,7 @@ class YuthonVacationReports(models.Model): 'last_holiday': last_month_record.last_holiday, 'last_workday': last_month_record.last_workday, 'valid_date1': last_month_record.valid_date1, + 'meal_fee': last_month_record.meal_fee, 'year_holiday': last_month_record.year_holiday, 'year_workday': last_month_record.year_workday, 'previous_year1': last_month_record.previous_year1,