Skip to content

[19.0][FIX] mail_tracking_mailgun: Remove DeprecationWarning warning#236

Merged
OCA-git-bot merged 1 commit into
OCA:19.0from
Tecnativa:19.0-fix-mail_tracking_mailgun-warning
Jul 22, 2026
Merged

[19.0][FIX] mail_tracking_mailgun: Remove DeprecationWarning warning#236
OCA-git-bot merged 1 commit into
OCA:19.0from
Tecnativa:19.0-fix-mail_tracking_mailgun-warning

Conversation

@victoralmau

Copy link
Copy Markdown
Member

Remove DeprecationWarning warning

WARNING prod py.warnings: /opt/odoo/auto/addons/mail_tracking_mailgun/controllers/main.py:28: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).

WARNING prod py.warnings: /opt/odoo/auto/addons/mail_tracking_mailgun/models/mail_tracking_email.py:106: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).

Please @pedrobaeza and @carlos-lopez-tecnativa can you review it?

@Tecnativa

@OCA-git-bot OCA-git-bot added series:19.0 mod:mail_tracking_mailgun Module mail_tracking_mailgun labels Jul 22, 2026
@pedrobaeza pedrobaeza added this to the 19.0 milestone Jul 22, 2026

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utcnow is also deprecated?

@victoralmau

Copy link
Copy Markdown
Member Author

utcnow is also deprecated?

You need to change utcnow when using fromtimestamp

File "/opt/odoo/auto/addons/mail_tracking_mailgun/controllers/main.py", line 28, in _mail_tracking_mailgun_webhook_verify
    processing_time = datetime.utcnow() - datetime.fromtimestamp(

TypeError: can't subtract offset-naive and offset-aware datetimes

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clear bugfix, so fast-tracking it

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 19.0-ocabot-merge-pr-236-by-pedrobaeza-bump-patch, awaiting test results.

WARNING prod py.warnings: /opt/odoo/auto/addons/mail_tracking_mailgun/controllers/main.py:28: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).

WARNING prod py.warnings: /opt/odoo/auto/addons/mail_tracking_mailgun/models/mail_tracking_email.py:106: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
@victoralmau
victoralmau force-pushed the 19.0-fix-mail_tracking_mailgun-warning branch from e0cbc02 to 5c6cb84 Compare July 22, 2026 09:08
@OCA-git-bot

Copy link
Copy Markdown
Contributor

@pedrobaeza your merge command was aborted due to failed check(s), which you can inspect on this commit of 19.0-ocabot-merge-pr-236-by-pedrobaeza-bump-patch.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

@pedrobaeza

Copy link
Copy Markdown
Member

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 19.0-ocabot-merge-pr-236-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 29fa761 into OCA:19.0 Jul 22, 2026
5 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at faf23bb. Thanks a lot for contributing to OCA. ❤️

@pedrobaeza
pedrobaeza deleted the 19.0-fix-mail_tracking_mailgun-warning branch July 22, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants