-
Notifications
You must be signed in to change notification settings - Fork 23.2k
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] event: display date of date_begin in the right tz #166071
Closed
jorenvo
wants to merge
1
commit into
odoo:17.0
from
odoo-dev:17.0-event-date-timezone-opw-3930916-jov
Closed
[FIX] event: display date of date_begin in the right tz #166071
jorenvo
wants to merge
1
commit into
odoo:17.0
from
odoo-dev:17.0-event-date-timezone-opw-3930916-jov
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The date on an event ticket can be wrong. To reproduce, create an event with a date_begin datetime that falls on the next UTC day. For example, specifying 2024-05-23 18:30 with the user's timezone as America/Los_Angeles results in a stored UTC time of 2024-05-24 01:30:00 (next day). Make sure the timezone of the public user is unset for simplicity's sake (it will fall back on that timezone), and then register for the event in an incognito window through the website. After registering, click "Download Tickets". The ticket PDF will display the UTC date. The event_registration_report_template_full_page_ticket wrapper sets the timezone in context: <t t-set="event" t-value="attendee.event_id._set_tz_context()"/> But ir.qweb.field.datetime doesn't use the record with attached context and only looks directly at the value. To make it work, tz_name must be specified explicitly. This is already done for the time part of date_begin below. opw-3930916
LGTM! the tz_name will indeed be used in value_to_html, setting the correct value in context_timestamp before formatting. |
Odoonan
changed the title
[FIX] event: display date part of date_begin in the right timezone
[FIX] event: display date of date_begin in the right tz
May 22, 2024
@Odoonan thanks for checking! Can you r+ it? I don't have the rights. |
@jeh-odoo Oy, can I get a delegate here? Cheers! |
@robodoo r+ |
robodoo
pushed a commit
that referenced
this pull request
May 23, 2024
The date on an event ticket can be wrong. To reproduce, create an event with a date_begin datetime that falls on the next UTC day. For example, specifying 2024-05-23 18:30 with the user's timezone as America/Los_Angeles results in a stored UTC time of 2024-05-24 01:30:00 (next day). Make sure the timezone of the public user is unset for simplicity's sake (it will fall back on that timezone), and then register for the event in an incognito window through the website. After registering, click "Download Tickets". The ticket PDF will display the UTC date. The event_registration_report_template_full_page_ticket wrapper sets the timezone in context: <t t-set="event" t-value="attendee.event_id._set_tz_context()"/> But ir.qweb.field.datetime doesn't use the record with attached context and only looks directly at the value. To make it work, tz_name must be specified explicitly. This is already done for the time part of date_begin below. opw-3930916 closes #166071 Signed-off-by: Noé Antoine (nan) <nan@odoo.com>
This was referenced May 23, 2024
@Odoonan thanks! |
lohwswilson
pushed a commit
to lohwswilson/odoo
that referenced
this pull request
Jun 5, 2024
The date on an event ticket can be wrong. To reproduce, create an event with a date_begin datetime that falls on the next UTC day. For example, specifying 2024-05-23 18:30 with the user's timezone as America/Los_Angeles results in a stored UTC time of 2024-05-24 01:30:00 (next day). Make sure the timezone of the public user is unset for simplicity's sake (it will fall back on that timezone), and then register for the event in an incognito window through the website. After registering, click "Download Tickets". The ticket PDF will display the UTC date. The event_registration_report_template_full_page_ticket wrapper sets the timezone in context: <t t-set="event" t-value="attendee.event_id._set_tz_context()"/> But ir.qweb.field.datetime doesn't use the record with attached context and only looks directly at the value. To make it work, tz_name must be specified explicitly. This is already done for the time part of date_begin below. opw-3930916 closes odoo#166071 Signed-off-by: Noé Antoine (nan) <nan@odoo.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The date on an event ticket can be wrong. To reproduce, create an event with a date_begin datetime that falls on the next UTC day. For example, specifying 2024-05-23 18:30 with the user's timezone as America/Los_Angeles results in a stored UTC time of 2024-05-24 01:30:00 (next day). Make sure the timezone of the public user is unset for simplicity's sake (it will fall back on that timezone), and then register for the event in an incognito window through the website. After registering, click "Download Tickets". The ticket PDF will display the UTC date.
The event_registration_report_template_full_page_ticket wrapper sets the timezone in context:
But ir.qweb.field.datetime doesn't use the record with attached context and only looks directly at the value. To make it work, tz_name must be specified explicitly. This is already done for the time part of date_begin below.
opw-3930916