Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] hr_holidays: apply timezone on request date #158042

Commits on Mar 25, 2024

  1. [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
    thle-odoo committed Mar 25, 2024
    Configuration menu
    Copy the full SHA
    86ee2a3 View commit details
    Browse the repository at this point in the history