Skip to content

[17.0][IMP] mail_gateway_whatsapp: Add parent_id when message is a response#1837

Open
bartacruz wants to merge 2 commits intoOCA:17.0from
bartacruz:17.0-mail_gateway_whatsapp-parent_id
Open

[17.0][IMP] mail_gateway_whatsapp: Add parent_id when message is a response#1837
bartacruz wants to merge 2 commits intoOCA:17.0from
bartacruz:17.0-mail_gateway_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, it doesn't show as a response in the chat window.
Basically, because the parent_id field is not set when posting the new message.

Code-wise, I've simply moved the related_message detection BEFORE calling message_post, and add the parent_id field to the method call.

@bartacruz
Copy link
Copy Markdown
Contributor Author

I've made a lot of small improvements to the whatsapp module, (audio files with player, image captions, actions for quickreply buttons, etc) but I'm not sure if it's best to make lots of small PRs or just squash them and make one big PR.
@Tecnativa @pedrobaeza @percevaq @diegonc @carlos-lopez-tecnativa would love your feedback!

@pedrobaeza pedrobaeza added this to the 17.0 milestone Mar 27, 2026
@pedrobaeza
Copy link
Copy Markdown
Member

About this PR, is there a way to reduce the diff to achieve the same effect?

About the rest of the features, proposing them individually will help review and eventual merging them.

@bartacruz
Copy link
Copy Markdown
Contributor Author

Thanks for the feedback!

About this PR: The diff is bigger than the actual changes because I'm moving a block of code upwards and changing the indentation of another block. The only REAL change is adding the parent_id field to message_post()

I don't see a way of achieving the same result effectively.

I mean, I can simply add the fetching of the related message before the call to message_post(), without touching anything else. It will work, the diff will be smaller, but it'll result in redundant code (the related message is fetched again afterwards...)

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