From 668764f35de1a811a19e8d4d50d7970d882310a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Taymans?= Date: Thu, 28 Feb 2019 18:30:51 +0100 Subject: [PATCH] [ADD] b_website_shift: shift status Show the shift status in the list of the next shifts of a worker. For small screen shift status is represented by a colored label. Add shift status as a label for the past shift of a worker on small screen. --- beesdoo_website_shift/controllers/main.py | 5 +- .../views/my_shift_website_templates.xml | 50 ++++++++++++++++++- 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/beesdoo_website_shift/controllers/main.py b/beesdoo_website_shift/controllers/main.py index db1e623..c37c3ec 100644 --- a/beesdoo_website_shift/controllers/main.py +++ b/beesdoo_website_shift/controllers/main.py @@ -334,6 +334,9 @@ class WebsiteShiftController(http.Controller): regular_next_shift_limit = int(request.env['ir.config_parameter'].get_param( 'beesdoo_website_shift.regular_next_shift_limit')) + # Get default status for fictive shifts + draft_status = request.env.ref('beesdoo_shift.draft') + for i in range(nb_subscribed_shifts, regular_next_shift_limit): # Create the fictive shift shift = main_shift.new() @@ -342,7 +345,7 @@ class WebsiteShiftController(http.Controller): shift.planning_id = main_shift.planning_id shift.task_type_id = main_shift.task_type_id shift.worker_id = main_shift.worker_id - shift.stage_id = main_shift.stage_id + shift.stage_id = draft_status shift.super_coop_id = main_shift.super_coop_id shift.color = main_shift.color shift.is_regular = main_shift.is_regular diff --git a/beesdoo_website_shift/views/my_shift_website_templates.xml b/beesdoo_website_shift/views/my_shift_website_templates.xml index fdb7eb1..f938142 100644 --- a/beesdoo_website_shift/views/my_shift_website_templates.xml +++ b/beesdoo_website_shift/views/my_shift_website_templates.xml @@ -96,6 +96,44 @@ + + + +