From 843fca298d3bf604c18f599de4ef7af096c88eac Mon Sep 17 00:00:00 2001 From: Carmen Bianca BAKKER Date: Tue, 16 May 2023 10:14:13 +0200 Subject: [PATCH] [IMP] shift: Better logging for generating next planning Signed-off-by: Carmen Bianca BAKKER --- shift/models/planning.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/shift/models/planning.py b/shift/models/planning.py index 3e7745ff4..d85c11c13 100644 --- a/shift/models/planning.py +++ b/shift/models/planning.py @@ -102,6 +102,14 @@ def _generate_next_planning(self): planning = self._get_next_planning(last_seq) planning = planning.with_context(visualize_date=date) + _logger.info( + "generating next shift planning:" + " (planning = %s, last_planning_seq = %s, next_planning_date = %s)", + planning.name, + last_seq, + date, + ) + if not planning.task_template_ids: _logger.error("Could not generate next planning: no task template defined.") return @@ -112,6 +120,12 @@ def _generate_next_planning(self): config.set_param("shift.last_planning_seq", planning.sequence) config.set_param("shift.next_planning_date", next_date) + _logger.info( + "setting next values: (last_planning_seq = %s, next_planning_date = %s)", + planning.sequence, + next_date, + ) + @api.model def get_future_shifts( self,