odoo/odoo#159380
Created by fw-bot
- label
- odoo-dev:master-17.0-opw-3789265-issue_timezone_time_off-thle-g5n8-fw
- head
- b286b4a0c4c7ee35ad6c42b4ca4eb3031603f7c1
- target
- master
- merged
- 1 month ago by Thomas Lefebvre (thle)
- forward-port of
- odoo/odoo#158042
[FW][FIX] hr_holidays: apply timezone on request date
Steps to reproduce:
-------------------
- be in a UTC+08:00 (or more) timezone
- go to Time Off dashboard
- click on a day (to request a leave)
Issue:
------
Default request dates are on 2 days instead of 1.
Cause:
------
Default request dates are determined during an onchange. The datetimes (`default_date_from/to`) are set in the context in UTC calculated in relation to the client's timezone.
Consequently, these datetimes can be set over several days. In the backend, we will use these datetimes and take only the day (because the `request_date_from/to` fields are of type date).
Solution:
---------
Put the values back into the client's timezone before they are truncated.
opw-3789265
Forward-Port-Of: odoo/odoo#159288
Forward-Port-Of: odoo/odoo#158042