Skip to content

[18.0][FIX] mail_gateway_whatsapp: Use the existing template to process imported data. - #1836

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

[18.0][FIX] mail_gateway_whatsapp: Use the existing template to process imported data.#1836
OCA-git-bot merged 1 commit into
OCA:18.0from
bartacruz:18.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.

It was fixed in 17.0 by #1833. This is a forward-port to 18.0

@bartacruz bartacruz changed the title Use the existing template to process imported data. [18.0][FIX] Use the existing template to process imported data. Mar 25, 2026
@bartacruz bartacruz changed the title [18.0][FIX] Use the existing template to process imported data. [18.0][FIX] mail_gateway_whatsapp: Use the existing template to process imported data. Mar 25, 2026
@pedrobaeza pedrobaeza added this to the 18.0 milestone Mar 27, 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.

Thanks for the fw-port. Let's fast-track it as already merged in 17:

/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-1836-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit f524ab0 into OCA:18.0 Mar 27, 2026
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

@bartacruz
bartacruz deleted the 18.0-whatsapp-fix-template-import branch March 28, 2026 21:43
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