diff --git a/energy_communities/data/mail_template_data.xml b/energy_communities/data/mail_template_data.xml index ea28a7111ae74fc6ac810fb56706e6ee9a931d16..cdc8ca615b27d825c982aaaf59ec0a7583a2c175 100644 --- a/energy_communities/data/mail_template_data.xml +++ b/energy_communities/data/mail_template_data.xml @@ -1,6 +1,6 @@ <?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[ diff --git a/energy_communities/wizards/assign_crm_to_coordinator_company.py b/energy_communities/wizards/assign_crm_to_coordinator_company.py index 359a156190dbea16c34bc78f828132ac1ca75964..6da46026557eb2485a0805c23703c0a37cf58ad8 100644 --- a/energy_communities/wizards/assign_crm_to_coordinator_company.py +++ b/energy_communities/wizards/assign_crm_to_coordinator_company.py @@ -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)