Browse Source

[FIX] b_shift : error messages

pull/125/head
Elouan Le Bars 5 years ago
parent
commit
8315ec9be4
  1. 15
      beesdoo_shift/models/attendance_sheet.py

15
beesdoo_shift/models/attendance_sheet.py

@ -327,10 +327,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":
@ -357,8 +365,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

Loading…
Cancel
Save