添加功能

This commit is contained in:
李鹏宇
2026-03-04 16:34:35 +08:00
parent a466c213fe
commit b46bb9252c
@@ -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"}