[MIG] mail_optional_follower_notification: Migration to 14.0
This commit is contained in:
parent
bc85608926
commit
c92749d93c
@ -6,7 +6,7 @@
|
|||||||
"author": "ACSONE SA/NV," "Odoo Community Association (OCA)",
|
"author": "ACSONE SA/NV," "Odoo Community Association (OCA)",
|
||||||
"website": "https://github.com/OCA/social",
|
"website": "https://github.com/OCA/social",
|
||||||
"category": "Social Network",
|
"category": "Social Network",
|
||||||
"version": "13.0.1.1.0",
|
"version": "14.0.1.0.0",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"depends": ["mail"],
|
"depends": ["mail"],
|
||||||
"data": ["wizard/mail_compose_message_view.xml"],
|
"data": ["wizard/mail_compose_message_view.xml"],
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from odoo import models
|
from odoo import models
|
||||||
|
from odoo.tools import config
|
||||||
|
|
||||||
|
|
||||||
class MailThread(models.AbstractModel):
|
class MailThread(models.AbstractModel):
|
||||||
@ -10,7 +11,12 @@ class MailThread(models.AbstractModel):
|
|||||||
def _notify_compute_recipients(self, message, msg_vals):
|
def _notify_compute_recipients(self, message, msg_vals):
|
||||||
"""Compute recipients to notify based on subtype and followers. This
|
"""Compute recipients to notify based on subtype and followers. This
|
||||||
method returns data structured as expected for ``_notify_recipients``."""
|
method returns data structured as expected for ``_notify_recipients``."""
|
||||||
|
test_condition = config["test_enable"] and not self.env.context.get(
|
||||||
|
"test_optional_follow_notification"
|
||||||
|
)
|
||||||
recipient_data = super()._notify_compute_recipients(message, msg_vals)
|
recipient_data = super()._notify_compute_recipients(message, msg_vals)
|
||||||
|
if test_condition:
|
||||||
|
return recipient_data
|
||||||
if "notify_followers" in self.env.context and not self.env.context.get(
|
if "notify_followers" in self.env.context and not self.env.context.get(
|
||||||
"notify_followers", False
|
"notify_followers", False
|
||||||
):
|
):
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
# Copyright 2019 ACSONE SA/NV (<http://acsone.eu>)
|
# Copyright 2019 ACSONE SA/NV (<http://acsone.eu>)
|
||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from odoo.tests import common
|
from odoo.tests.common import SavepointCase
|
||||||
|
|
||||||
|
|
||||||
class TestMailOptionalFollowernotifications(common.SavepointCase):
|
class TestMailOptionalFollowernotifications(SavepointCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
super().setUpClass()
|
super().setUpClass()
|
||||||
@ -20,6 +20,7 @@ class TestMailOptionalFollowernotifications(common.SavepointCase):
|
|||||||
"default_model": "res.partner",
|
"default_model": "res.partner",
|
||||||
"default_res_id": cls.partner_01.id,
|
"default_res_id": cls.partner_01.id,
|
||||||
"default_composition_mode": "comment",
|
"default_composition_mode": "comment",
|
||||||
|
"test_optional_follow_notification": True,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
cls.mail_compose_context = ctx
|
cls.mail_compose_context = ctx
|
||||||
|
Loading…
Reference in New Issue
Block a user