Browse Source

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

pull/124/head
Elouan Le Bars 5 years ago
parent
commit
69915b0c16
  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_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):
self._add_follower(values)

Loading…
Cancel
Save