Skip to content

[19.0][MIG] fetchmail_thread_default - #1898

Open
KKamaa wants to merge 43 commits into
OCA:19.0from
KKamaa:19.0-mig-fetchmail_thread_default
Open

[19.0][MIG] fetchmail_thread_default#1898
KKamaa wants to merge 43 commits into
OCA:19.0from
KKamaa:19.0-mig-fetchmail_thread_default

Conversation

@KKamaa

@KKamaa KKamaa commented Aug 5, 2026

Copy link
Copy Markdown

No description provided.

yajo and others added 30 commits August 6, 2026 00:34
This addon lets the sysadmin choose a default mail thread sink for incoming mails.

You can use it to forward all unbound incoming emails to a `mail.channel` where only certain users are subscribed and can triage them.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: social-13.0/social-13.0-fetchmail_thread_default
Translate-URL: https://translation.odoo-community.org/projects/social-13-0/social-13-0-fetchmail_thread_default/
On fetchmail_thread_default when creating a new mail.message it says the context["fetchmail_server_id"] is None, the field value is context["default_fetchmail_server_id"].
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: social-14.0/social-14.0-fetchmail_thread_default
Translate-URL: https://translation.odoo-community.org/projects/social-14-0/social-14-0-fetchmail_thread_default/
Currently translated at 12.5% (1 of 8 strings)

Translation: social-14.0/social-14.0-fetchmail_thread_default
Translate-URL: https://translation.odoo-community.org/projects/social-14-0/social-14-0-fetchmail_thread_default/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: social-16.0/social-16.0-fetchmail_thread_default
Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-fetchmail_thread_default/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: social-16.0/social-16.0-fetchmail_thread_default
Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-fetchmail_thread_default/
Currently translated at 100.0% (4 of 4 strings)

Translation: social-16.0/social-16.0-fetchmail_thread_default
Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-fetchmail_thread_default/it/
Currently translated at 100.0% (4 of 4 strings)

Translation: social-16.0/social-16.0-fetchmail_thread_default
Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-fetchmail_thread_default/pt_BR/
Currently translated at 100.0% (4 of 4 strings)

Translation: social-16.0/social-16.0-fetchmail_thread_default
Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-fetchmail_thread_default/it/
@OCA-git-bot OCA-git-bot added mod:fetchmail_thread_default Module fetchmail_thread_default series:19.0 labels Aug 5, 2026
@thomaspaulb

Copy link
Copy Markdown

@OCA/social-maintainers

@thomaspaulb thomaspaulb changed the title 19.0 mig fetchmail thread default [19.0][MIG] fetchmail_thread_default Aug 10, 2026
@thomaspaulb

Copy link
Copy Markdown

/ocabot migration fetchmail_thread_default

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Aug 10, 2026
@OCA-git-bot OCA-git-bot mentioned this pull request Aug 10, 2026
6 tasks
@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). 🤖

# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Default Thread For Unbounded Emails",
"summary": "Post unkonwn messages to an existing thread",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

s/unkonw/unknown/

strip_attachments=False,
thread_id=None,
):
server = self.env["fetchmail.server"].browse(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is only needed when either model or thread_id are not set. So in many cases the browse action will be done for no purpose. Better to split the if condition like so:

if not (model or thread_id):
    server = self.env["fetchmail.server"].browse(
        self.env.context.get("default_fetchmail_server_id")
    )
    if server.default_thread_id:
            model = server.default_thread_id._name
            thread_id = server.default_thread_id.id

I kept the not (model or thread_id) but I wonder whether this is correct. A thread_id with no model does not make sense. But a model with thread_id filled will lead to creation of a new record in the model. We can assume no thread_id is passed without a model, but the following condition should be enough: if not model.

@NL66278 NL66278 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.

👍 No really blocking issues, but if you could take up my comments, that would be nice.

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.