Browse Source

[FIX] b_shift : error messages

pull/143/head
Elouan Le Bars 4 years ago
parent
commit
eedc759b00
  1. 15
      beesdoo_shift/models/attendance_sheet.py

15
beesdoo_shift/models/attendance_sheet.py

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

Loading…
Cancel
Save