Skip to content

[19.0][MIG] mail_gateway: Migration to 19.0 - #202

Merged
OCA-git-bot merged 71 commits into
OCA:19.0from
komit-consulting:19.0-mig-mail_gateway
Oct 2, 2026
Merged

OCA-git-bot merged 71 commits into
OCA:19.0from
komit-consulting:19.0-mig-mail_gateway

Conversation

@DucTruongKomit

@DucTruongKomit DucTruongKomit commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

[MIG] mail_gateway: Migration to 19.0

@pedrobaeza

Copy link
Copy Markdown
Member

Thanks for the move. I'm afraid you have lost the commit history. You should do a similar method than the migration one, but adding an extra remote for OCA/social.

@DucTruongKomit
DucTruongKomit force-pushed the 19.0-mig-mail_gateway branch 14 times, most recently from 5e50ef4 to 7c9d8cc Compare June 1, 2026 11:17
@DucTruongKomit

Copy link
Copy Markdown
Contributor Author

Thanks for the move. I'm afraid you have lost the commit history. You should do a similar method than the migration one, but adding an extra remote for OCA/social.

yes, I did.

@pedrobaeza

Copy link
Copy Markdown
Member

Can you check CIs?

@DucTruongKomit
DucTruongKomit force-pushed the 19.0-mig-mail_gateway branch 3 times, most recently from 0ec67ff to a649485 Compare June 2, 2026 01:31
@DucTruongKomit
DucTruongKomit marked this pull request as draft June 2, 2026 04:01
@DucTruongKomit
DucTruongKomit force-pushed the 19.0-mig-mail_gateway branch 3 times, most recently from 56e4d37 to 6e924d8 Compare June 5, 2026 09:30

@huan-tq huan-tq left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Functional Testing:

  • The Menus introduced by this module are available.
  • The Gateway buttons are available throughout the system.
  • This is a base module intended to be extended by other mail_gateway modules.

LGTM.

@DucTruongKomit
DucTruongKomit force-pushed the 19.0-mig-mail_gateway branch 2 times, most recently from 8706f65 to e169248 Compare June 12, 2026 10:05
OCA-git-bot and others added 16 commits October 2, 2026 15:45
Currently translated at 34.6% (51 of 147 strings)

Translation: social-18.0/social-18.0-mail_gateway
Translate-URL: https://translation.odoo-community.org/projects/social-18-0/social-18-0-mail_gateway/gl/
Currently translated at 100.0% (147 of 147 strings)

Translation: social-18.0/social-18.0-mail_gateway
Translate-URL: https://translation.odoo-community.org/projects/social-18-0/social-18-0-mail_gateway/es/
…om gateway discuss to a record

Before this changes when creating the new message when pressing link button, notifications where created too. So the message was notified to the record followers.

After this changes, the message is created but not notified to the followers.
Currently translated at 95.9% (141 of 147 strings)

Translation: social-18.0/social-18.0-mail_gateway
Translate-URL: https://translation.odoo-community.org/projects/social-18-0/social-18-0-mail_gateway/gl/
Currently translated at 98.6% (145 of 147 strings)

Translation: social-18.0/social-18.0-mail_gateway
Translate-URL: https://translation.odoo-community.org/projects/social-18-0/social-18-0-mail_gateway/gl/
Odoo 18 renamed the Thread record field `lastInterestDateTime` to
`lastInterestDt` (defined in mail/static/src/core/common/thread_model.js;
used by the "chats" category sort in
mail/static/src/core/public_web/discuss_app_category_model.js).

The 17.0 patch was ported unchanged, so `compareDatetime()` compares
`undefined` with `undefined` and silently falls back to `t2.id - t1.id`:
gateway channels end up stacked by creation order instead of last
activity.

Use the 18.0 field name so the gateway category is sorted by last
interest again, most recent first.
The patch on Store.one_id is applied at import time, so it is shared by
every registry served by the process, while gateway_channel_ids only
exists in the registries where mail_gateway is installed. A database
without the module, served by a worker that already imported it, fails
with an AttributeError inside session_info(), which leaves its whole
backend unreachable.

Check the registry the call actually runs against before reading the
field.
…ll a member

Otherwise, bus notifications keep arriving after leaving the channel, and an AccessError is raised because the user is no longer a member.
…ateway_user security group

The members in the gateway are used to set the default members for new channels. However, in day-to-day use, if new users are added to the mail_gateway.gateway_user group, they do not automatically become members of existing channels.

With the native option to invite people, new users can join the channel. However, for security reasons, we limit this to users who belong to the mail_gateway.gateway_user group.

Core has a feature that uses the group_public_id field to set a group that restricts which users can be invited. However, this only works when channel_type = 'channel'. See https://github.com/odoo/odoo/blob/5249e0b082cfff650e1dad36aade470cf25a1ad5/addons/mail/models/discuss/discuss_channel.py#L90
Store.one_id() builds the reference to a record rather than its content,
and its docstring asks callers to avoid it. Sending the gateway channels
from a res.partner._to_store() override instead, the way hr_holidays and
im_livechat extend partner store data, removes the need for the registry
guard added in #1913: a model override only exists in the registries
where its module is installed.

_thread_to_store() read the channels back from the follower references
and passed them on as gateway_followers without ever adding the partners
to the store, so it relates them with Store.many() now.
@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@OCA-git-bot OCA-git-bot added mod:mail_forward Module mail_forward mod:mail_print Module mail_print labels Oct 2, 2026
@DucTruongKomit

Copy link
Copy Markdown
Contributor Author

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

It should be fixed now. thank you

@pedrobaeza

Copy link
Copy Markdown
Member

/ocabot merge nobump

@OCA-git-bot

Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 19.0-ocabot-merge-pr-202-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 7de1ea4 into OCA:19.0 Oct 2, 2026
9 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

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.