diff --git a/beesdoo_shift/models/planning.py b/beesdoo_shift/models/planning.py index fd87ab7..2e6efcc 100644 --- a/beesdoo_shift/models/planning.py +++ b/beesdoo_shift/models/planning.py @@ -86,7 +86,7 @@ class TaskTemplate(models.Model): duration = fields.Float(help="Duration in Hour") worker_nb = fields.Integer(string="Number of worker", help="Max number of worker for this task", default=1) - worker_ids = fields.Many2many('res.partner', string="Recurrent worker assigned", domain=[('eater', '=', 'worker_eater')]) + worker_ids = fields.Many2many('res.partner', string="Recurrent worker assigned", domain=[('eater', '=', 'worker_eater'), ('working_mode', '=', 'regular')]) remaining_worker = fields.Integer(compute="_get_remaining", store=True, string="Remaining Place") active = fields.Boolean(default=True) #For Kanban View Only diff --git a/beesdoo_shift/models/task.py b/beesdoo_shift/models/task.py index 39121fc..72790d4 100644 --- a/beesdoo_shift/models/task.py +++ b/beesdoo_shift/models/task.py @@ -28,7 +28,7 @@ class Task(models.Model): task_template_id = fields.Many2one('beesdoo.shift.template') planning_id = fields.Many2one(related='task_template_id.planning_id', store=True) task_type_id = fields.Many2one('beesdoo.shift.type', string="Task Type") - worker_id = fields.Many2one('res.partner', track_visibility='onchange', domain=[('eater', '=', 'worker_eater')]) + worker_id = fields.Many2one('res.partner', track_visibility='onchange', domain=[('eater', '=', 'worker_eater'), ('working_mode', 'in', ('regular', 'irregular'))]) start_time = fields.Datetime(track_visibility='always', index=True) end_time = fields.Datetime(track_visibility='always') stage_id = fields.Many2one('beesdoo.shift.stage', required=True, track_visibility='onchange', default=lambda self: self.env.ref('beesdoo_shift.open'))