|
@ -319,10 +319,18 @@ class AttendanceSheet(models.Model): |
|
|
|
|
|
|
|
|
worker = self.env["res.partner"].search([("barcode", "=", barcode)]) |
|
|
worker = self.env["res.partner"].search([("barcode", "=", barcode)]) |
|
|
if not len(worker): |
|
|
if not len(worker): |
|
|
raise UserError(_("Worker not found (invalid barcode or status).")) |
|
|
|
|
|
|
|
|
raise UserError( |
|
|
|
|
|
_( |
|
|
|
|
|
"Worker not found (invalid barcode or status). \nBarcode : %s" |
|
|
|
|
|
) |
|
|
|
|
|
% barcode |
|
|
|
|
|
) |
|
|
if len(worker) > 1: |
|
|
if len(worker) > 1: |
|
|
raise UserError( |
|
|
raise UserError( |
|
|
_("Multiple workers are corresponding this barcode.") |
|
|
|
|
|
|
|
|
_( |
|
|
|
|
|
"Multiple workers are corresponding this barcode. \nBarcode : %s" |
|
|
|
|
|
) |
|
|
|
|
|
% barcode |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
if worker.state == "unsubscribed": |
|
|
if worker.state == "unsubscribed": |
|
@ -349,8 +357,7 @@ class AttendanceSheet(models.Model): |
|
|
if worker.working_mode not in ("regular", "irregular"): |
|
|
if worker.working_mode not in ("regular", "irregular"): |
|
|
raise UserError( |
|
|
raise UserError( |
|
|
_("%s is %s and should be regular or irregular.") |
|
|
_("%s is %s and should be regular or irregular.") |
|
|
% worker.name, |
|
|
|
|
|
worker.working_mode, |
|
|
|
|
|
|
|
|
% (worker.name, worker.working_mode) |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
# Expected shifts status update |
|
|
# Expected shifts status update |
|
|