Skip to content

[17.0][FIX] mail_gateway_whatsapp: Use the existing template to process imported data - #1833

Merged
OCA-git-bot merged 1 commit into
OCA:17.0from
bartacruz:17.0-whatsapp-fix-template-import
Mar 25, 2026
Merged

[17.0][FIX] mail_gateway_whatsapp: Use the existing template to process imported data#1833
OCA-git-bot merged 1 commit into
OCA:17.0from
bartacruz:17.0-whatsapp-fix-template-import

Conversation

@bartacruz

Copy link
Copy Markdown
Contributor

When attempting to update templates from Meta, if a template with buttons already exists in the gateway configuration, the import process will fail because it cannot find the existing buttons and attempts to create them (again), causing the SQL constraint unique_name_for_template to fail.
The reason being that even if the imported template exists, the code calls the update method using an empty recordset instead of the actual existing template.

I've previously proposed another solution to this in #1831 , but as @pedrobaeza noted, it was easier than that.

@pedrobaeza pedrobaeza added this to the 17.0 milestone Mar 25, 2026
pedrobaeza
pedrobaeza approved these changes Mar 25, 2026

@luisDIXMIT luisDIXMIT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Simply change, LGTM!

@pedrobaeza

Copy link
Copy Markdown
Member

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 17.0-ocabot-merge-pr-1833-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 7802f8e into OCA:17.0 Mar 25, 2026
6 of 9 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

@pedrobaeza

Copy link
Copy Markdown
Member

Can you please fw-port it to 18?

@bartacruz

Copy link
Copy Markdown
Contributor Author

Can you please fw-port it to 18?

I will

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