Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] mail: try to parse scheduled date input
``scheduled_date`` field of ``mail.mail`` is a char field since its addition in 2015 (see 364b4ba). As its first usage was in combination with mail templates, a char field was used to simplify its implementation. However this technically allows to store whatever value in that field. Using it in a filter with a datetime argument is quite strange. A workaround is to try to parse as much as possible the inputs, remove timezone information, try to localize it, and have it in regular server format to enable filtering on it. We consider value should be set in UTC. If we have a specific timezone set on the input we localize it to UTC. Otherwise we consider the input was done in UTC, as all datetime fields. It is the role of the business code generating mail.mail to either give the timezone, either already convert into UTC. This might solve the following bug Step to reproduce: activate the developer mode go to settings - technical - emails create a new email and set the Scheduled Send Date in the future run the scheduled action Mail: Email Queue Manager Current behavior: the email is sent and the action does not consider the filter Expected behavior: the email is not sent and will only be sent when the scheduler detects that scheduled_date exceeds the current time. Task-2833300 opw-2823106 closes #94770 Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
- Loading branch information
1 parent
9d3d0d0
commit 582ac8d
Showing
4 changed files
with
121 additions
and
9 deletions.
There are no files selected for viewing
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
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
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
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