|
@ -320,7 +320,6 @@ class AttendanceSheet(models.Model): |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
def on_barcode_scanned(self, barcode): |
|
|
def on_barcode_scanned(self, barcode): |
|
|
|
|
|
|
|
|
if self.state == "validated": |
|
|
if self.state == "validated": |
|
|
raise UserError( |
|
|
raise UserError( |
|
|
_("You cannot modify a validated attendance sheet.") |
|
|
_("You cannot modify a validated attendance sheet.") |
|
@ -345,11 +344,14 @@ class AttendanceSheet(models.Model): |
|
|
for id in self.expected_shift_ids.ids: |
|
|
for id in self.expected_shift_ids.ids: |
|
|
shift = self.env["beesdoo.shift.sheet.expected"].browse(id) |
|
|
shift = self.env["beesdoo.shift.sheet.expected"].browse(id) |
|
|
if ( |
|
|
if ( |
|
|
shift.worker_id == worker |
|
|
|
|
|
or shift.replacement_worker_id == worker |
|
|
|
|
|
): |
|
|
|
|
|
|
|
|
shift.worker_id == worker and not shift.replacement_worker_id |
|
|
|
|
|
) or shift.replacement_worker_id == worker: |
|
|
shift.stage = "present" |
|
|
shift.stage = "present" |
|
|
return |
|
|
return |
|
|
|
|
|
if shift.worker_id == worker and shift.replacement_worker_id: |
|
|
|
|
|
raise UserError( |
|
|
|
|
|
_("%s was expected as replaced.") % worker.name |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
if worker.working_mode == "regular": |
|
|
if worker.working_mode == "regular": |
|
|
regular_task_type = "compensation" |
|
|
regular_task_type = "compensation" |
|
|