[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",
|
"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)",
|
"author": "Therp BV,Creu Blanca,Odoo Community Association (OCA)",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"category": "Social Network",
|
"category": "Social Network",
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
from odoo import models
|
from odoo import models
|
||||||
|
from odoo.tools import config
|
||||||
from odoo.tools.safe_eval import safe_eval
|
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 = super(MailThread, self)._message_add_suggested_recipient(
|
||||||
result, partner=partner, email=email, reason=reason
|
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[
|
domain = self.env[
|
||||||
"mail.wizard.invite"
|
"mail.wizard.invite"
|
||||||
]._mail_restrict_follower_selection_get_domain()
|
]._mail_restrict_follower_selection_get_domain()
|
||||||
|
Loading…
Reference in New Issue
Block a user