Skip to content

Commit

Permalink
Merge pull request #451 from frePPLe/17.0
Browse files Browse the repository at this point in the history
Syncing from upstream frePPLe/odoo (17.0)
  • Loading branch information
bt-admin authored Jun 28, 2024
2 parents 4b3cac6 + 2a9d64f commit 9886a17
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions frepple/controllers/outbound.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ def export_calendar(self):
"calendar_id",
"week_type",
"resource_id",
"day_period",
],
):
if i["calendar_id"] and i["calendar_id"][0] in cal_ids:
Expand All @@ -572,7 +573,11 @@ def export_calendar(self):
if not i["resource_id"]:
if calendar_name not in calendars:
calendars[calendar_name] = []
i["attendance"] = True
i["attendance"] = (
True
if i["day_period"] in ("morning", "afternoon")
else False
)
calendars[calendar_name].append(i)

if calendar_resource.get(i["calendar_id"][0]):
Expand All @@ -593,7 +598,11 @@ def export_calendar(self):
"calendar for %s"
% (self.resources_with_specific_calendars[res],)
] = cal_tz[calendar_name]
i["attendance"] = True
i["attendance"] = (
True
if i["day_period"] in ("morning", "afternoon")
else False
)
calendars[
"calendar for %s"
% (self.resources_with_specific_calendars[res],)
Expand Down Expand Up @@ -658,22 +667,14 @@ def export_calendar(self):
# ONE-WEEK CALENDAR
yield '<bucket start="%s" end="%s" value="%s" days="%s" priority="%s" starttime="%s" endtime="%s"/>\n' % (
(
self.formatDateTime(j["date_from"], cal_tz[i])
if not j["attendance"]
else (
j["date_from"].strftime("%Y-%m-%dT00:00:00")
if j["date_from"]
else "2020-01-01T00:00:00"
)
j["date_from"].strftime("%Y-%m-%dT00:00:00")
if j["date_from"]
else "2020-01-01T00:00:00"
),
(
self.formatDateTime(j["date_to"], cal_tz[i])
if not j["attendance"]
else (
j["date_to"].strftime("%Y-%m-%dT00:00:00")
if j["date_to"]
else "2030-12-31T00:00:00"
)
j["date_to"].strftime("%Y-%m-%dT00:00:00")
if j["date_to"]
else "2030-12-31T00:00:00"
),
"1" if j["attendance"] else "0",
(
Expand Down

0 comments on commit 9886a17

Please sign in to comment.