[FIX] hr_homeworking: fix homeworking using localized week name for technical field

https://github.com/odoo/odoo/pull/137502 changed how we handle homeworking
records. However, it would throw a traceback if luxon was using any non
english localizations to get the week name of a date. This commit fixes this by
setting the us location before getting the weekname as we rely on it to get the
default data for that day.

closes odoo/odoo#138831

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Leonardo Pavan Rocha
2023-10-17 08:53:16 +00:00
parent 0c3927f4da
commit f13ea80fe4
@@ -34,7 +34,7 @@ patch(AttendeeCalendarModel.prototype, {
for (const day of rangeInterval) {
const startDay = day.s;
const dayISO = startDay.toISODate();
const dayName = startDay.weekdayLong.toLowerCase();
const dayName = startDay.setLocale("us").weekdayLong.toLowerCase();
if (!(dayISO in events)) {
events[dayISO] = {};
}