Browse Source

[ADD] b_shift : constraint on worker, cannot replace himself

pull/143/head
Elouan Le Bars 5 years ago
parent
commit
8b452d5eac
  1. 3
      beesdoo_shift/models/task.py

3
beesdoo_shift/models/task.py

@ -85,6 +85,9 @@ class Task(models.Model):
'is_regular': False, 'is_regular': False,
'is_compensation': False, 'is_compensation': False,
}) })
if task.worker_id:
if task.worker_id == task.replaced_id:
raise UserError("A worker cannot replace himself.")
def message_auto_subscribe(self, updated_fields, values=None): def message_auto_subscribe(self, updated_fields, values=None):
self._add_follower(values) self._add_follower(values)

Loading…
Cancel
Save