Skip to content

Commit

Permalink
[IMP] mail_gateway: Fine-tune default values for gateway behavior rel…
Browse files Browse the repository at this point in the history
…ated to the current user

- Use OdooBot for webhooks instead of the current user, following the same logic as Odoo.
- Avoid automatically adding the current user as a member of a new gateway to prevent notifications for all messages. This is now an explicit configuration.
  • Loading branch information
carlos-lopez-tecnativa committed Nov 18, 2024
1 parent 843eb4f commit f3b76db
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mail_gateway/models/mail_gateway.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright 2024 Dixmit
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import Command, api, fields, models, tools
from odoo import api, fields, models, tools


class MailGateway(models.Model):
Expand All @@ -25,12 +25,10 @@ class MailGateway(models.Model):
)
webhook_user_id = fields.Many2one(
"res.users",
default=lambda self: self.env.user.id,
default=lambda self: self.env.ref("base.user_root"),
help="User that will create the messages",
)
member_ids = fields.Many2many(
"res.users", default=lambda self: [Command.link(self.env.user.id)]
)
member_ids = fields.Many2many("res.users")
company_id = fields.Many2one(
"res.company", default=lambda self: self.env.company.id
)
Expand Down

0 comments on commit f3b76db

Please sign in to comment.