Skip to content

Commit

Permalink
[IMP] shift: Better logging for generating next planning
Browse files Browse the repository at this point in the history
Signed-off-by: Carmen Bianca BAKKER <[email protected]>
  • Loading branch information
carmenbianca committed May 16, 2023
1 parent a897570 commit 843fca2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions shift/models/planning.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 843fca2

Please sign in to comment.