[IMP] mail_restrict_follower_selection: Add condition for tests
This commit is contained in:
parent
7a4b1aa462
commit
a09f5c8068
@ -4,7 +4,7 @@
|
||||
|
||||
{
|
||||
"name": "Restrict follower selection",
|
||||
"version": "13.0.1.0.0",
|
||||
"version": "13.0.1.0.1",
|
||||
"author": "Therp BV,Creu Blanca,Odoo Community Association (OCA)",
|
||||
"license": "AGPL-3",
|
||||
"category": "Social Network",
|
||||
|
@ -1,4 +1,5 @@
|
||||
from odoo import models
|
||||
from odoo.tools import config
|
||||
from odoo.tools.safe_eval import safe_eval
|
||||
|
||||
|
||||
@ -11,6 +12,11 @@ class MailThread(models.AbstractModel):
|
||||
result = super(MailThread, self)._message_add_suggested_recipient(
|
||||
result, partner=partner, email=email, reason=reason
|
||||
)
|
||||
test_condition = config["test_enable"] and not self.env.context.get(
|
||||
"test_restrict_follower"
|
||||
)
|
||||
if test_condition or self.env.context.get("no_restrict_follower"):
|
||||
return result
|
||||
domain = self.env[
|
||||
"mail.wizard.invite"
|
||||
]._mail_restrict_follower_selection_get_domain()
|
||||
|
Loading…
Reference in New Issue
Block a user