From 0d2f032f2af22f19ef1f32864480d88b892fc530 Mon Sep 17 00:00:00 2001 From: Elouan Le Bars Date: Tue, 5 Nov 2019 10:52:43 +0100 Subject: [PATCH] [FIX] b_shift : warning messages --- beesdoo_shift/models/task.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/beesdoo_shift/models/task.py b/beesdoo_shift/models/task.py index 8e4a638..f8c3aef 100644 --- a/beesdoo_shift/models/task.py +++ b/beesdoo_shift/models/task.py @@ -190,9 +190,8 @@ class Task(models.Model): ABSENT = self.env.ref('beesdoo_shift.absent') EXCUSED = self.env.ref('beesdoo_shift.excused') NECESSITY = self.env.ref('beesdoo_shift.excused_necessity') - if not (self.worker_id or self.replaced_id) and new_stage in (DONE, ABSENT, EXCUSED, NECESSITY): - raise UserError(_("You cannot change to the status %s if the is no worker defined on the shift") % new_stage.name) + raise UserError(_("You cannot change to the status %s if no worker is defined for the shift") % new_stage.name) if update or not (self.worker_id or self.replaced_id): return @@ -233,7 +232,7 @@ class Task(models.Model): data['irregular_absence_counter'] = -1 else: - raise UserError(_("The worker has not a proper working mode define, please check the worker is subscribed")) + raise UserError(_("Working mode is not properly defined. Please check if the worker is subscribed")) status.sudo()._change_counter(data) self._set_revert_info(data, status)