From bb546c909074f0d135dea927450e1eac89d517d5 Mon Sep 17 00:00:00 2001 From: Elouan Le Bars Date: Mon, 9 Dec 2019 18:35:24 +0100 Subject: [PATCH] [IMP] b_shift : no exception raised when scanning a worker twice --- beesdoo_shift/models/attendance_sheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beesdoo_shift/models/attendance_sheet.py b/beesdoo_shift/models/attendance_sheet.py index 27411bb..5283641 100644 --- a/beesdoo_shift/models/attendance_sheet.py +++ b/beesdoo_shift/models/attendance_sheet.py @@ -360,7 +360,7 @@ class AttendanceSheet(models.Model): added_ids = map(lambda s: s.worker_id.id, self.added_shift_ids) if worker.id in added_ids: - raise UserError(_("Worker is already present.")) + return self.added_shift_ids |= self.added_shift_ids.new( {