Skip to content

[18.0][FIX] mail_gateway_whatsapp: Add parent_id when message is a response.#1848

Merged
OCA-git-bot merged 1 commit into
OCA:18.0from
bartacruz:18.0-whatsapp_parent_id
Apr 20, 2026
Merged

[18.0][FIX] mail_gateway_whatsapp: Add parent_id when message is a response.#1848
OCA-git-bot merged 1 commit into
OCA:18.0from
bartacruz:18.0-whatsapp_parent_id

Conversation

@bartacruz
Copy link
Copy Markdown
Contributor

When a message from whatsapp arrives and it's a response from a message sent from Odoo, set the parent_id field.

In doing so, discuss correctly shows the message as a response, like this:
image

Also, having the parent_id set is very useful for detecting template's button responses.

@bartacruz
Copy link
Copy Markdown
Contributor Author

This is an enhancement of #1837.
As @pedrobaeza requested, I've found a way to reduce the diff, and provided a test case.
If/when this PR is approved, i'll do a 17.0 back-port.

@pedrobaeza pedrobaeza added this to the 18.0 milestone Apr 9, 2026
Copy link
Copy Markdown
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Thanks. Please check pre-commit

)
.mail_message_id
)
new_message.parent_id = related_message and related_message.id
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.

Suggested change
new_message.parent_id = related_message and related_message.id
new_message.parent_id = related_message.id

@pedrobaeza
Copy link
Copy Markdown
Member

Please always squash these suggestions/changes into the existing commit.

@bartacruz bartacruz force-pushed the 18.0-whatsapp_parent_id branch from a02dcd8 to 0be000d Compare April 9, 2026 18:08
@bartacruz
Copy link
Copy Markdown
Contributor Author

Please always squash these suggestions/changes into the existing commit.
Yes, i'm on it

@bartacruz
Copy link
Copy Markdown
Contributor Author

bartacruz commented Apr 9, 2026

Is there a way that I can run the pre-commit tests locally?
EDIT: I've found it. installed pre-commit hooks.

When a message from whatsapp arrives and it's a response from a message sent from Odoo, set the parent_id field.
@bartacruz bartacruz force-pushed the 18.0-whatsapp_parent_id branch from 0be000d to 9d7a8e9 Compare April 17, 2026 20:30
@OCA-git-bot OCA-git-bot added series:18.0 mod:mail_gateway_whatsapp Module mail_gateway_whatsapp labels Apr 17, 2026
@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@pedrobaeza
Copy link
Copy Markdown
Member

/ocabot merge patch

@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 18.0-ocabot-merge-pr-1848-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 5d3621c into OCA:18.0 Apr 20, 2026
7 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

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

@bartacruz bartacruz deleted the 18.0-whatsapp_parent_id branch April 20, 2026 15:42
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.

4 participants