diff --git a/data/mail_data.xml b/data/mail_data.xml index bd760ced72f21d2c2fe4b96b82d4101a7bba2579..c7933fc179a249bb157dba1e3797bd2c4efc41c6 100644 --- a/data/mail_data.xml +++ b/data/mail_data.xml @@ -3,11 +3,12 @@ <data> <record id="acc_mail_template_data_portal_welcome" model="mail.template"> - <field name="name">Portail ACC: nouvel utilisateur</field> + <field name="name">Portail ACC : nouvel utilisateur</field> <field name="model_id" ref="base.model_res_partner" /> <field name="subject">Votre espace adhérent ${'list_op' in ctx and ctx['list_op'] or ''}</field> <field name="email_to">${object.email}</field> <field name="email_from">app@elo.coop</field> + <field name="email_from">"Elocoop de la part de ${'list_op' in ctx and ctx['list_op'] or ''}" <app@elo.coop></field> <field name="body_html" type="html"> <table border="0" @@ -24,32 +25,39 @@ > <tbody> <!-- HEADER --> - <tr> - <td align="center" style="min-width: 590px;"> - <table - border="0" - cellpadding="0" - cellspacing="0" - width="590" - style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;" - > - <tr><td valign="middle"></td> - <td valign="middle" align="right"> - <img - src="/logo.png?company=${'company_id' in ctx and ctx['company_id'] or ''}" - style="padding: 0px; margin: 0px; height: auto; width: 80px;" - alt="" - /> - </td></tr> - <tr><td colspan="2" style="text-align:center;"> - <hr - width="100%" - style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin:16px 0px 16px 0px;" - /> - </td></tr> - </table> - </td> - </tr> +<!-- <tr>--> +<!-- <td align="center" style="min-width: 590px;">--> +<!-- <table--> +<!-- border="0"--> +<!-- cellpadding="0"--> +<!-- cellspacing="0"--> +<!-- width="590"--> +<!-- style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;"--> +<!-- >--> +<!-- <tr><td valign="middle"></td>--> +<!-- <td valign="middle" align="right">--> +<!--<!– <img–>--> +<!--<!– t-att-src="image_data_uri(operation_id.image)"–>--> +<!--<!– style="max-height: 50px;"–>--> +<!--<!– alt="Logo"–>--> +<!--<!– />–>--> +<!-- <img t-attf-src="data:image/*;base64,${'operation_img' in ctx and ctx['operation_img'] or ''}"--> +<!-- style="padding: 0px; margin: 0px; height: auto; width: 80px;"/>--> +<!--<!– <img–>--> +<!--<!– src="/logo.png?company=${'company_id' in ctx and ctx['company_id'] or ''}"–>--> +<!--<!– style="padding: 0px; margin: 0px; height: auto; width: 80px;"–>--> +<!--<!– alt=""–>--> +<!--<!– />–>--> +<!-- </td></tr>--> +<!-- <tr><td colspan="2" style="text-align:center;">--> +<!-- <hr--> +<!-- width="100%"--> +<!-- style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin:16px 0px 16px 0px;"--> +<!-- />--> +<!-- </td></tr>--> +<!-- </table>--> +<!-- </td>--> +<!-- </tr>--> <!-- CONTENT --> <tr> <td align="center" style="min-width: 590px;"> @@ -63,10 +71,10 @@ <tr><td valign="top" style="font-size: 13px;"> <div> Bonjour ${object.firstname or ''} ${object.lastname or ''},<br - /> <br /> + /><br /> Vous faites partie de l'opération d'autoconsommation collective ${'list_op' in ctx and ctx['list_op'] or ''}. Afin d’accéder aisément aux informations liées à cette opération, un espace adhérent vous est réservé sur la plateforme Elocoop.<br /><br /> - Vous y trouverez:<br /> + Vous y trouverez :<br /> <ul> <li @@ -79,26 +87,22 @@ >vos différents contrats et documents.</li> </ul> - <p - >Voici les informations pour accéder à votre espace adhérent:<br + Voici les informations pour accéder à votre espace adhérent :<br /> - - Votre identifiant (email): ${object.email or ''}<br + - Votre identifiant (email) : ${object.email or ''}<br /> - - Votre mot de passe à activer grâce au lien suivant:<br/> + - Votre mot de passe à activer grâce au lien suivant :<br/> <a href="${'user_signup_url' in ctx and ctx['user_signup_url'] or ''}" > ${'user_signup_url' in ctx and ctx['user_signup_url'] or ''} - </a> - </p><br/> - <p - >Une fois votre mot de passe crée, vous pouvez accéder à votre espace adhérent en suivant ce lien : + </a><br/><br/> + Une fois votre mot de passe créé, vous pouvez accéder à votre espace adhérent en suivant ce lien : <a href="${'portal_url' in ctx and ctx['portal_url'] or ''}" - >${'portal_url' in ctx and ctx['portal_url'] or ''}</a></p> - <br /> + >${'portal_url' in ctx and ctx['portal_url'] or ''}</a><br/><br/> Bonne journée,<br /> - Service adhérent ${'list_op' in ctx and ctx['list_op'] or ''}, + Service adhérent ${'list_op' in ctx and ctx['list_op'] or ''} </div> </td></tr> <tr><td style="text-align:center;"> @@ -180,7 +184,7 @@ <div> Bonjour ${object.name},<br /><br /> Nous avons reçu une demande de réinitialisation de mot de passe pour votre compte de la plateforme d'Autoconsommation Enercoop. - Cliquez sur ce lien, valable 24 heures, pour le changer:<br + Cliquez sur ce lien, valable 24 heures, pour le changer :<br /> <div style="margin: 16px 0px 16px 0px;"> <a diff --git a/models/res_partner.py b/models/res_partner.py index 8ae42450cc4a6e578e4f1b9d63ccc60aa3e0715f..4f6b2cb9e757fd9e6824202ae0db1bf14b11cbc8 100644 --- a/models/res_partner.py +++ b/models/res_partner.py @@ -121,6 +121,7 @@ class ResPartner(models.Model): template = self.env.ref("acc_portal.acc_mail_template_data_portal_welcome") lang = user_portal.lang company_id = self.env.company + operation_id = self.env["acc.counter"].search([("partner_id", "=", self.id)], limit=1).acc_operation_id user_signup_url = self.with_context( signup_force_type_in_url="", lang=lang )._get_signup_url_app()[self.id] @@ -142,7 +143,7 @@ class ResPartner(models.Model): template.with_context( dbname=self._cr.dbname, portal_url=portal_url, - company_id=company_id.id, + operation_img=operation_id.image_1920, user_signup_url=user_signup_url, list_op=op_str, lang=lang,