From 903767dfbfd96b88f2bf6c30e92c8355ebd5efdd Mon Sep 17 00:00:00 2001 From: Robin Keunen Date: Fri, 4 Mar 2022 16:46:38 +0100 Subject: [PATCH] Update beesdoo_shift/models/cooperative_status.py Co-authored-by: Carmen Bianca Bakker --- beesdoo_shift/models/cooperative_status.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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)