Skip to content
Snippets Groups Projects
Commit 1588fb36 authored by konykon's avatar konykon
Browse files

Merge branch 'fix/send-mail-once' into 'dev'

Fix/Send crm lead request notification once to each subscriber

See merge request !197
parents 4bf14f02 ca763d60
Branches dev
No related tags found
2 merge requests!197Fix/Send crm lead request notification once to each subscriber,!195[REL] 14.0.2.0.0
Pipeline #45807 passed
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data noupdate="1">
<data>
<record id="email_templ_lead_assigned_to_coordinator_id" model="mail.template">
<field
......@@ -12,7 +12,6 @@
>[Somcomunitats.coop] Request for registration of the Energy Community on the platform</field>
<field name="email_to">${ctx.get('email_to')}</field>
<field name="model_id" ref="model_crm_lead" />
<field name="auto_delete" eval="True" />
<field name="lang">${object.company_id.partner_id.lang}</field>
<field name="body_html">
<![CDATA[
......
......@@ -49,9 +49,8 @@ class AssignCRMToCoordinatorCompanyWizard(models.TransientModel):
if followers:
self.crm_lead_id.message_subscribe(partner_ids=followers.partner_id.ids)
# notify followers
for follower in followers:
email_values = {"email_to": follower.partner_id.email}
template = self.env.ref(
"energy_communities.email_templ_lead_assigned_to_coordinator_id"
).with_context(email_values)
self.crm_lead_id.message_post_with_template(template.id)
email_values = {"email_to": followers.mapped("partner_id.email")}
template = self.env.ref(
"energy_communities.email_templ_lead_assigned_to_coordinator_id"
).with_context(email_values)
self.crm_lead_id.message_post_with_template(template.id)
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