diff --git a/beesdoo_shift/models/cooperative_status.py b/beesdoo_shift/models/cooperative_status.py index e5a34cd55..924eb8687 100644 --- a/beesdoo_shift/models/cooperative_status.py +++ b/beesdoo_shift/models/cooperative_status.py @@ -453,8 +453,7 @@ def _compute_next_shift(self): next_shift_by_worker = {} for shift in next_shifts: # take fist shift for each worker - if shift.worker_id.id not in next_shift_by_worker: - next_shift_by_worker[shift.worker_id.id] = shift + next_shift_by_worker.setdefault(shift.worker_id.id, shift) for rec in self: rec.next_shift_id = next_shift_by_worker.get(rec.cooperator_id.id)