From eedc759b00c622f74c8247e4e8f269c67e8ab9f2 Mon Sep 17 00:00:00 2001 From: Elouan Le Bars Date: Tue, 28 Jan 2020 11:21:05 +0100 Subject: [PATCH] [FIX] b_shift : error messages --- beesdoo_shift/models/attendance_sheet.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/beesdoo_shift/models/attendance_sheet.py b/beesdoo_shift/models/attendance_sheet.py index 2f2c441..366b963 100644 --- a/beesdoo_shift/models/attendance_sheet.py +++ b/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