Skip to content
Snippets Groups Projects
Commit 6ece4364 authored by konykon's avatar konykon
Browse files

Add followers

parent c33129ed
No related branches found
No related tags found
2 merge requests!195[REL] 14.0.2.0.0,!161Fix/edit email templates
This commit is part of merge request !195. Comments created here will be created in the context of that merge request.
......@@ -86,3 +86,15 @@ class CRMLeadService(Component):
elif source_xml_id == "ce_source_general_info":
template_external_id = "email_templ_lead_request_platform_news_confirm_id"
return template_external_id
def add_follower(self, crm_lead_id):
instance_admin = self.env.ref("energy_communities.role_ce_manager").id
company_id = crm_lead_id.company_id.id
followers = self.env["res.users"].search(
[
("role_line_ids.role_id", "=", instance_admin),
("company_ids.id", "=", company_id)
]
)
if followers:
crm_lead_id.message_subscribe(partner_ids=followers.partner_id.ids)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment