添加功能
This commit is contained in:
@@ -97,7 +97,8 @@ class YuthonDutyPlan(models.Model):
|
||||
self.zu = zu
|
||||
if zu == len(self.plan_line_ids):
|
||||
zu = 0
|
||||
for employee in self.plan_line_ids[zu].employee_ids:
|
||||
sorted_plan_line_ids = self.plan_line_ids.sorted(key=lambda r: r.sequence)
|
||||
for employee in sorted_plan_line_ids[zu].employee_ids:
|
||||
employee_id = self.env['planning.slot'].search([('resource_id', '=', employee.resource_id.id), ('start_datetime', '>=', first_day_of_month), ('start_datetime', '<=', last_day_of_month)]).sorted('start_datetime')
|
||||
if i < len(employee_id):
|
||||
start_hour2 = int(role_template_b.start_time)
|
||||
@@ -116,6 +117,7 @@ class YuthonDutyPlan(models.Model):
|
||||
i += 1
|
||||
zu += 1
|
||||
current_date2 += timedelta(days=1)
|
||||
|
||||
else:
|
||||
i = 0
|
||||
zu = self.zu +1
|
||||
@@ -123,7 +125,8 @@ class YuthonDutyPlan(models.Model):
|
||||
while current_date2 <= last_day_of_month:
|
||||
if zu == len(self.plan_line_ids):
|
||||
zu = 0
|
||||
for employee in self.plan_line_ids[zu].employee_ids:
|
||||
sorted_plan_line_ids = self.plan_line_ids.sorted(key=lambda r: r.sequence)
|
||||
for employee in sorted_plan_line_ids[zu].employee_ids:
|
||||
employee_id = self.env['planning.slot'].search(
|
||||
[('resource_id', '=', employee.resource_id.id), ('start_datetime', '>=', first_day_of_month),
|
||||
('start_datetime', '<=', last_day_of_month)]).sorted('start_datetime')
|
||||
|
||||
Reference in New Issue
Block a user