添加功能

This commit is contained in:
zhou
2025-03-18 11:04:04 +08:00
parent 9e95f88d1e
commit 2ff053b78c
@@ -66,10 +66,17 @@ class YuthonDutyPlan(models.Model):
first_day_of_month = datetime(next_year, 1, 1)
last_day_of_month = datetime(next_year,2, 1)
else:
first_day_of_month = datetime(next_year, latest_month+1, 1)
next_next_month = (latest_month % 12) + 1
next_year = year + (1 if next_month == 1 else 0)
last_day_of_month = datetime(next_year, next_next_month+1, 1)
next_year = latest_year
next_month = latest_month + 1
first_day_of_month = datetime(next_year, next_month, 1)
# 计算下下一个月的第一天
if next_month == 12:
next_next_year = next_year + 1
next_next_month = 1
else:
next_next_year = next_year
next_next_month = next_month + 1
last_day_of_month = datetime(next_next_year, next_next_month, 1)
role_a = self.env['planning.role'].search([('name', '=', '联安粮库')], limit=1)
role_template_a = self.env['planning.slot.template'].search([('planning_name', '=', '白班'), ('role_id', '=', role_a.id)])
role_template_b = self.env['planning.slot.template'].search([('planning_name', '=', '白值'), ('role_id', '=', role_a.id)])