From 3c29a5321bc3f61b02a1218392db68671fa9cd64 Mon Sep 17 00:00:00 2001 From: Thibault Francois Date: Sat, 24 Mar 2018 16:08:26 +0100 Subject: [PATCH] =?UTF-8?q?[FIX]=200044=5Fk=20-=20emp=C3=AAcher=20d'inscri?= =?UTF-8?q?re=20=C3=A0=20un=20shift=20ou=20cr=C3=A9neau=20si=20pas=20de=20?= =?UTF-8?q?r=C3=A9gime=20d=C3=A9finir:=20add=20a=20domain=20based=20on=20w?= =?UTF-8?q?orking=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- beesdoo_shift/models/planning.py | 2 +- beesdoo_shift/models/task.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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'))