Skip to content

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

Open
bartacruz wants to merge 1 commit intoOCA:18.0from
bartacruz:18.0-whatsapp_parent_id
Open

[18.0][FIX] mail_gateway_whatsapp: Add parent_id when message is a response.#1848
bartacruz wants to merge 1 commit intoOCA: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.

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 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants