[18.0][FIX] mail_gateway: Fix channel member duplicates - #1883
Open
DevOpsMBAConsultings wants to merge 1 commit into
Open
[18.0][FIX] mail_gateway: Fix channel member duplicates#1883DevOpsMBAConsultings wants to merge 1 commit into
DevOpsMBAConsultings wants to merge 1 commit into
Conversation
pedrobaeza
reviewed
Jul 9, 2026
| members.append( | ||
| Command.create( | ||
| { | ||
| "partner_id": author._name == "res.partner" and author.id, |
Member
There was a problem hiding this comment.
Why are you removing the part that checks the model?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Module:
mail_gatewayWhen a webhook is received and the
author(sender) happens to be one of the users already configured ingateway.member_ids, the previous logic resulted in theauthor'spartner_idbeing appended to thememberslist even though it was already iterated over fromgateway.member_ids.partner_id.This caused Odoo's
discuss.channel.createto fail withpsycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "discuss_channel_member_partner_id_channel_id_uniq".Fix: Using a
setfor the member partner IDs and explicitly verifying thatauthor.id not in member_pidsbefore appending ensurespartner_idis unique.