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

[FW][FIX] hr_holidays: apply timezone on request date #159380

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Mar 26, 2024

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: #159288
Forward-Port-Of: #158042

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

X-original-commit: a5a860f
@robodoo
Copy link
Contributor

robodoo commented Mar 26, 2024

@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 26, 2024

@thle-odoo @Bertrand2 this PR targets master and is the last of the forward-port chain containing:

To merge the full chain, use

@fw-bot r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Mar 26, 2024
@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 26, 2024

@thle-odoo @Bertrand2 ci/runbot failed on this forward-port PR

@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Mar 26, 2024
@thle-odoo
Copy link
Contributor

@fw-bot r+

robodoo pushed a commit that referenced this pull request Mar 28, 2024
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

closes #159380

X-original-commit: a5a860f
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
robodoo pushed a commit that referenced this pull request Mar 28, 2024
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

closes #159380

X-original-commit: a5a860f
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
robodoo pushed a commit that referenced this pull request Mar 28, 2024
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

closes #159380

X-original-commit: a5a860f
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
robodoo pushed a commit that referenced this pull request Mar 29, 2024
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

closes #159380

X-original-commit: a5a860f
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
@robodoo robodoo closed this Mar 29, 2024
@robodoo robodoo added the 17.3 label Mar 29, 2024
@fw-bot fw-bot deleted the master-17.0-opw-3789265-issue_timezone_time_off-thle-g5n8-fw branch April 12, 2024 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
17.3 forwardport This PR was created by @fw-bot OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants