Open ccremer opened 1 year ago
I've just tested this in our test Odoo (july 2022 instance) and it was easy to add a field and column:
Implementation challenge in Odootools:
In the Report.prepareDays
method we create the DailySummary
data objects for each day in advance. Those are until now always in the same timezone. Now, if we consider the edge case where someone works on the same day as the flight (e.g. at the airport or offline during the flight) then travelling vancouver would be "going back in time" and the shifts might be associated to the wrong day. Granted, this is an edge case that we can avoid by putting the hours elsewhere.
However, sorting the attendances ascending by date will also be somewhat tricky.
We might deal with this by displaying a day twice in the report, one for each timezone.
Currently we save the timezone in the payslip and it applies to the whole month. This is a major drawback for people that are changing timezones in the middle of the month, because recording attendance becomes a major pain.
The most correct way is to record attendance with the timezone information. Unfortunately Odoo 8 stores timestamps in UTC without timezone flag.
It might be possible to add a column in the timesheet view that contains the timezone field. If possible, an implementation could look like this:
x_timezone
field to the Attendance data model in Odootimezone
to the timesheet view. The users working abroad can then set the timezone for each attendance, similarly how Sick Leave is recorded in a Dropdown menu.Europe/Zurich
, either via Odoo itself or at latest in Odootools.x_timezone
field of anAttendance
entryx_timezone
field of the current month's payslipEurope/Zurich
as the last-resort fallback (so that Switzerland-based employees don't need to change anything)There is one advantage with saving the timezone in payslip: A timezone can be applied to the whole month. So if an employee is the whole month outside Switzerland, they can just save it once in the payslip and not record every individual attendance with the timezone field.
That being said, this feature resp. extra column is only relevant for people changing the timezone in the middle of the month, since the timezone for a whole month can still be specified via payslip.
Reasoning: User experience It's easier to record attendance in the local timezone and set the timezone in the column from a dropdown, than having to record all attendances of a month in a single timezone when changing timezones in the middle of the month.