-
-
Notifications
You must be signed in to change notification settings - Fork 623
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] mail_tracking: Migration to 17.0
TT49060
- Loading branch information
1 parent
549006c
commit e981f3c
Showing
73 changed files
with
1,208 additions
and
1,290 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from . import models | ||
from . import controllers | ||
from . import models | ||
from . import wizards |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from . import main | ||
from . import discuss | ||
from . import mailbox |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2024 Tecnativa - David Vidal | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
from odoo.http import request, route | ||
|
||
from odoo.addons.mail.controllers.mailbox import MailboxController | ||
|
||
|
||
class MailTrackingMailBoxController(MailboxController): | ||
@route("/mail/failed/messages", methods=["POST"], type="json", auth="user") | ||
def discuss_failed_messages( | ||
self, search_term=None, before=None, after=None, limit=30, around=None | ||
): | ||
"""Fetch failed messages for discuss""" | ||
res = request.env["mail.message"]._message_fetch( | ||
[("is_failed_message", "=", True)], | ||
search_term=search_term, | ||
before=before, | ||
after=after, | ||
around=around, | ||
limit=limit, | ||
) | ||
return {**res, "messages": res["messages"].message_format()} | ||
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright 2020 Tecnativa - Alexandre Díaz | ||
# Copyright 2024 Tecnativa - David Vidal | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import api, models | ||
|
||
|
||
class MailAliasDomain(models.Model): | ||
_inherit = "mail.alias.domain" | ||
|
||
@api.model_create_multi | ||
def create(self, vals_list): | ||
"""We've got `mail.alias.get_aliases` method which is cached os we need | ||
to refresh the cache when we add a new alias domain""" | ||
res = super().create(vals_list) | ||
self.env.registry.clear_cache() | ||
return res | ||
|
||
def write(self, vals): | ||
"""We've got `mail.alias.get_aliases` method which is cached os we need | ||
to refresh the cache when we add a new alias domain""" | ||
res = super().write(vals) | ||
if "catchall_alias" in vals: | ||
self.env.registry.clear_cache() | ||
return res | ||
|
||
def unlink(self): | ||
"""We've got `mail.alias.get_aliases` method which is cached os we need | ||
to refresh the cache when we remove an alias domain""" | ||
res = super().unlink() | ||
self.env.registry.clear_cache() | ||
return res |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright 2024 Tecnativa - David Vidal | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
from odoo import models | ||
|
||
|
||
class MailGuest(models.Model): | ||
_inherit = "mail.guest" | ||
|
||
def _init_messaging(self): | ||
"""For discuss""" | ||
values = super()._init_messaging() | ||
values["failed_counter"] = False | ||
return values |
This file contains 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
Oops, something went wrong.