添加功能

This commit is contained in:
李鹏宇
2026-01-27 18:47:35 +08:00
parent deff363c2b
commit bcc673cd09
@@ -1032,10 +1032,7 @@ class YuthonVacationReports(models.Model):
base_month = int(base_line.select_month)
base_date = date(base_year, base_month, 1)
self.env['yuthon.overtime.line'].search([]).unlink()
# 上上个月第一天(用于select_month赋值)
last_month_first = (base_date - relativedelta(months=2)).replace(day=1)
# 上上个月最后一天(时间筛选的截止点)
current_month_last = (base_date - relativedelta(months=1)).replace(day=1) - timedelta(days=1)
current_month_last = base_date - timedelta(days=1)
current_month_last_dt = datetime.combine(current_month_last, datetime.min.time())
dec_2025_end = datetime(2025, 12, 31, 23, 59, 59)
if self.env.user.company_id.name == '集团本部':
@@ -1077,8 +1074,8 @@ class YuthonVacationReports(models.Model):
'carry_forward_quantity': 0.0,
'carry_forward_date': line.carry_forward_date,
'remaining_quantity': 0.0,
'select_month': str(last_month_first.month),
'select_year': str(last_month_first.year)
'select_month': str(current_month_last.month),
'select_year': str(current_month_last.year)
}
summary = employee_summary[emp_id]
@@ -1103,7 +1100,6 @@ class YuthonVacationReports(models.Model):
base_month = int(base_line.select_month)
base_date = date(base_year, base_month, 1)
self.env['yuthon.overtime.line'].search([]).unlink()
next_month_first = (base_date + relativedelta(months=1)).replace(day=1)
next_month_last = (base_date + relativedelta(months=2)).replace(day=1) - timedelta(days=1)
next_month_last_dt = datetime.combine(next_month_last, datetime.min.time())
dec_2025_end = datetime(2025, 12, 31, 23, 59, 59)
@@ -1144,8 +1140,8 @@ class YuthonVacationReports(models.Model):
'public_holidays': 0.0,
'carry_forward_quantity': 0.0,
'carry_forward_date': line.carry_forward_date,
'select_month': str(next_month_first.month),
'select_year': str(next_month_first.year)
'select_month': str(next_month_last.month),
'select_year': str(next_month_last.year)
}
summary = employee_summary[emp_id]