[MERGE][REF] mail, various: make templates great and bioutifoul again

In this commit we improve templates used in nearly all odoo addons. Purpose
of this commit is to have templates that embed or use standard Odoo email
layouts to make them look modern and have a common style across all emails.

Main guidelines

 * better use of div / p / br to try to lessen layout issues, especially
   when updating templates using the editor;
 * correctly sequence the templates fields definition;
 * correctly set templates values notably auto_delete and user_signature
   fields to avoid confusion;
 * correctly layout the email content using light notification email. It
   can either propagate the layout choice through various send mail methods
   or directly embed the styling in the templates for more technical or
   complex templates;
 * use email_formatted computed field when possible to avoid having hand-made
   from / to addresses;
 * fix various typos and improve subjects when necessary;

Content of emails is not necessarily updated as the purpose of this task is
about styling, not content itself.

This merge also contains some additional code allowing to layout email sent
through the send_mail of mail.template and the send_mail of survey.compose.
message. It allows to strip the layouting part of the email and keep only the
content in the template body. Some technical templates keep the full layout
to keep the possibility of easily send them through various pieces of code.

This merge is linked to main task 1868112 and closes main PR #25889. It is the
summary and review of several tasks and several PRs:

  * task ID 1843361 and closes PR #25287
  * task ID 1843171 and closes PR #25293
  * task ID 1843395 and closes PR #25294
  * task ID 1843122 and closes PR #25295
  * task ID 1843360 and closes PR #25299
  * task ID 1843224 and closes PR #25313
  * task ID 1843151 and closes PR #25346
  * task ID 1843376 and closes PR #25349
  * task ID 1841503 and closes PR #25388
  * task ID 1843136 and closes PR #25412

Thanks to all contributors and testers for this task !
This commit is contained in:
Thibault Delavallée
2018-07-24 15:34:16 +02:00
38 changed files with 1576 additions and 1231 deletions
+22 -13
View File
@@ -4,24 +4,32 @@
<!--Email template -->
<record id="mail_template_data_payment_receipt" model="mail.template">
<field name="name">Payment Receipt - Send by Email</field>
<field name="name">Payment Receipt: Send by email</field>
<field name="model_id" ref="account.model_account_payment"/>
<field name="subject">${object.company_id.name} Payment Receipt (Ref ${object.name or 'n/a' })</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="model_id" ref="account.model_account_payment"/>
<field name="auto_delete" eval="True"/>
<field name="body_html" type="xml">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
Dear ${object.partner_id.name}<br/><br/>
Thank you for your payment.
Here is your payment receipt <strong>${(object.name or '').replace('/','-')}</strong> amounting
to <strong>${format_amount(object.amount, object.currency_id)}</strong> from ${object.company_id.name}.
<br /><br />
Do not hesitate to contact us if you have any question.
<br/><br/>
Best regards,<br/>
% if user and user.signature:
${user.signature | safe}
% endif
</p>
</div>
</field>
<field name="report_template" ref="account.action_report_payment_receipt"/>
<field name="report_name">${(object.name or '').replace('/','-')}</field>
<field name="lang">${object.partner_id.lang}</field>
<field name="body_html" type="xml">
<p>Dear ${object.partner_id.name},</p>
<p>Thank you for your payment.<br />Here is your payment receipt <strong>${(object.name or '').replace('/','-')}</strong> amounting to <strong>${format_amount(object.amount, object.currency_id)}</strong> from ${object.company_id.name}.</p>
<p>If you have any questions, please do not hesitate to contact us.</p>
<p>Best regards,
% if user and user.signature:
${user.signature | safe}
% endif
</p>
</field>
<field name="auto_delete" eval="True"/>
<field name="user_signature" eval="False"/>
</record>
<act_window name="Send Receipt By Email"
@@ -39,6 +47,7 @@ ${user.signature | safe}
'default_res_id': active_id,
'default_template_id': ref('account.mail_template_data_payment_receipt'),
'force_email': True,
'custom_layout': 'mail.mail_notification_light',
}"
/>
</data>
+248 -140
View File
@@ -1,40 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!-- Email template for reset password -->
<record id="reset_password_email" model="mail.template">
<field name="name">Auth Signup: Reset Password</field>
<field name="model_id" ref="base.model_res_users"/>
<field name="email_from"><![CDATA["${object.company_id.name|safe}" <${(object.company_id.email or user.email)|safe}>]]></field>
<field name="email_to">${object.email|safe}</field>
<field name="subject">Password reset</field>
<field name="body_html"><![CDATA[
<div style="padding:0px;width:600px;margin:auto;background: #FFFFFF repeat top /100%;color:#777777">
<table cellspacing="0" cellpadding="0" style="width:600px;border-collapse:collapse;background:inherit;color:inherit">
<tbody><tr>
<td valign="center" width="200" style="padding:10px 10px 10px 5px;font-size: 12px">
<img src="/logo.png" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${user.company_id.name}">
</td>
</tr></tbody>
<field name="email_from">${('"%s" &lt;%s&gt;' % (object.company_id.name, object.company_id.email or user.email))|safe}</field>
<field name="email_to">${object.email_formatted | safe}</field>
<field name="body_html" type="html">
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">
<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">
<span style="font-size: 10px;">Your Account</span><br/>
<span style="font-size: 20px; font-weight: bold;">
${object.name}
</span>
</td><td valign="middle" align="right">
<img src="/logo.png?company=${object.company_id.id}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${object.company_id.name}"/>
</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;">
<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="top" style="font-size: 13px;">
<div>
Dear ${object.name},<br/><br/>
A password reset was requested for the Odoo account linked to this email.
You may change your password by following this link which will remain valid during 24 hours:<br/>
<div style="margin: 16px 0px 16px 0px;">
<a href="${object.signup_url}"
style="background-color: #875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;">
Change password
</a>
</div>
If you do not expect this, you can safely ignore this email.<br/><br/>
Thanks,<br/>
${user.signature | safe}<br/>
</div>
</td></tr>
<tr><td 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>
<!-- FOOTER -->
<tr>
<td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;">
<tr><td valign="middle" align="left">
${object.company_id.name}
</td></tr>
<tr><td valign="middle" align="left" style="opacity: 0.7;">
${object.company_id.phone}
% if object.company_id.email
| <a href="'mailto:%s' % ${object.company_id.email}" style="text-decoration:none; color: #454748;">${object.company_id.email}</a>
% endif
% if object.company_id.website
| <a href="'%s' % ${object.company_id.website}" style="text-decoration:none; color: #454748;">
${object.company_id.website}
</a>
% endif
</td></tr>
</table>
</td>
</tr>
</tbody>
</table>
</td></tr>
<!-- POWERED BY -->
<tr><td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;">
<tr><td style="text-align: center; font-size: 13px;">
Powered by <a target="_blank" href="https://www.odoo.com" style="color: #875A7B;">Odoo</a>
</td></tr>
</table>
</div>
<div style="padding:0px;width:600px;margin:auto;background: #FFFFFF repeat top /100%;color:#777777">
<p>Dear ${object.name},</p>
<p>A password reset was requested for the Odoo account linked to this email.</p>
<p>You may change your password by following this link which will remain valid during 24 hours:</p>
<div style="text-align: center; margin-top: 16px;">
<a href="${object.signup_url}" style="padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#875A7B; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px">Change password</a>
</div>
<p>If you do not expect this, you can safely ignore this email.</p>
<p>Best regards,</p>
</div>
<div style="padding:0px;width:600px;margin:auto; margin-top: 10px; background: #fff repeat top /100%;color:#777777">
${user.signature | safe}
<p style="font-size: 11px; margin-top: 10px;">
<strong>Sent by ${user.company_id.name} using <a href="www.odoo.com" style="text-decoration:none; color: #875A7B;">Odoo</a></strong>
</p>
</div>]]></field>
</td></tr>
</table>
</field>
<field name="auto_delete" eval="True"/>
<field name="user_signature" eval="False"/>
</record>
@@ -42,93 +98,96 @@
<record id="set_password_email" model="mail.template">
<field name="name">Auth Signup: Odoo Connection</field>
<field name="model_id" ref="base.model_res_users"/>
<field name="email_from">"${object.company_id.name|safe}" &lt;${object.company_id.email or user.email|safe}&gt;</field>
<field name="email_to">"${object.name}" &lt;${object.email|safe}&gt;</field>
<field name="subject">${object.create_uid.name} from ${object.company_id.name} invites you to connect to Odoo</field>
<field name="email_from">"${object.company_id.name|safe}" &lt;${object.company_id.email or user.email|safe}&gt;</field>
<field name="email_to">${object.email_formatted | safe}</field>
<field name="body_html" type="html">
<table border="0" cellpadding="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;">
<tr>
<td align="center">
<table border="0" width="590" cellpadding="0" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">
<tbody>
<tr>
<td align="center" style="min-width: 590px;">
<table width="590" border="0" cellpadding="0" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
<tr>
<td valign="middle">
<span style="font-size: 20px;">
<strong>Welcome to Odoo!</strong>
</span>
</td>
<td valign="middle" align="right">
<img src="/web/static/src/img/logo.png" style="padding: 0px; margin: 0px; height: auto; width: 80px;"/>
</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 width="590" border="0" cellpadding="0" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
<tr>
<td valign="top" style="font-size: 14px;">
<div style="margin-top:15px; margin-bottom:15px;">
Dear ${object.name},
</div>
<div style="margin-top:15px; margin-bottom:15px;">
You have been invited by ${object.create_uid.name} of ${object.company_id.name} to connect on Odoo.
</div>
<div style="text-align: center; margin-top: 16px;margin-bottom: 16px;">
<a href="${object.signup_url}" style="padding: 12px; color: #FFFFFF; border-color:#875A7B; text-decoration: none; display: inline-block; text-align: center; cursor: pointer; background-image: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px;">Accept invitation</a>
<br/>
<div style="margin-top:15px; margin-bottom:15px; line-height:1;">
% set website_url = object.env['ir.config_parameter'].sudo().get_param('web.base.url')
Your Odoo domain is: <br/>
<b><a href='${website_url}'>${website_url}</a></b>
</div>
<div style="margin-top:15px; margin-bottom:15px;line-height:1;">
Your sign in email is: <br/>
<b><a href="/web/login?login=${object.email}" target="_blank">${object.email}</a></b>
</div>
</div>
<div style="margin-top:15px; margin-bottom:15px;">
Never heard of Odoo? It’s a all-in-one business software loved by 3+ million users. It will considerably improve your experience at work and increase your productivity.
</div>
<div style="margin-top:15px; margin-bottom:15px;">
Have a look at the <a href="https://www.odoo.com/page/tour" style="color: #875A7B;">Odoo Tour</a> to discover the tool.
</div>
<div style="margin-top:15px;">
Enjoy Odoo!
</div>
<div style="margin-top:15px; margin-bottom:15px;">
--<br/>The ${object.company_id.name} Team
</div>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">
<tbody>
<!-- HEADER -->
<tr>
<td align="center" style="min-width: 590px;">
<table width="590" border="0" cellpadding="0" style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;">
<tr>
<td style="text-align: center; font-size: 14px;">
Powered by <a target="_blank" href="https://www.odoo.com" style="color: #875A7B;">Odoo</a>
</td>
</tr>
<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">
<span style="font-size: 10px;">Welcome to Odoo</span><br/>
<span style="font-size: 20px; font-weight: bold;">
${object.name}
</span>
</td><td valign="middle" align="right">
<img src="/logo.png?company=${object.company_id.id}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${object.company_id.name}"/>
</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;">
<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="top" style="font-size: 13px;">
<div>
Dear ${object.name},<br /><br />
You have been invited by ${object.create_uid.name} of ${object.company_id.name} to connect on Odoo.
<div style="margin: 16px 0px 16px 0px;">
<a href="${object.signup_url}"
style="background-color: #875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;">
Accept invitation
</a>
</div>
% set website_url = object.env['ir.config_parameter'].sudo().get_param('web.base.url')
Your Odoo domain is: <b><a href='${website_url}'>${website_url}</a></b><br />
Your sign in email is: <b><a href="/web/login?login=${object.email}" target="_blank">${object.email}</a></b><br /><br />
Never heard of Odoo? It’s a all-in-one business software loved by 3+ million users. It will considerably improve your experience at work and increase your productivity.
<br /><br />
Have a look at the <a href="https://www.odoo.com/page/tour" style="color: #875A7B;">Odoo Tour</a> to discover the tool.
<br /><br />
Enjoy Odoo!<br />
--<br/>The ${object.company_id.name} Team
</div>
</td></tr>
<tr><td 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>
<!-- FOOTER -->
<tr>
<td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;">
<tr><td valign="middle" align="left">
${object.company_id.name}
</td></tr>
<tr><td valign="middle" align="left" style="opacity: 0.7;">
${object.company_id.phone}
% if object.company_id.email
| <a href="'mailto:%s' % ${object.company_id.email}" style="text-decoration:none; color: #454748;">${object.company_id.email}</a>
% endif
% if object.company_id.website
| <a href="'%s' % ${object.company_id.website}" style="text-decoration:none; color: #454748;">
${object.company_id.website}
</a>
% endif
</td></tr>
</table>
</td>
</tr>
</tbody>
</table>
</td></tr>
<!-- POWERED BY -->
<tr><td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;">
<tr><td style="text-align: center; font-size: 13px;">
Powered by <a target="_blank" href="https://www.odoo.com" style="color: #875A7B;">Odoo</a>
</td></tr>
</table>
</td></tr>
</table></field>
<field name="auto_delete" eval="True"/>
<field name="user_signature" eval="False"/>
</record>
@@ -136,42 +195,91 @@
<record id="mail_template_user_signup_account_created" model="mail.template">
<field name="name">Auth Signup: Odoo Account Created</field>
<field name="model_id" ref="base.model_res_users"/>
<field name="email_from">"${object.company_id.name|safe}" &lt;${(object.company_id.email or user.email)|safe}&gt;</field>
<field name="email_to">${object.email|safe}</field>
<field name="subject">Welcome to ${object.company_id.name}!</field>
<field name="email_from">"${object.company_id.name|safe}" &lt;${(object.company_id.email or user.email)|safe}&gt;</field>
<field name="email_to">${object.email_formatted | safe}</field>
<field name="body_html" type="html">
<div style="padding:0px;width:600px;margin:auto;background: #FFFFFF repeat top /100%;color:#777777">
<table cellspacing="0" cellpadding="0" style="width:600px;border-collapse:collapse;background:inherit;color:inherit">
<tbody><tr>
<td valign="center" width="200" style="padding:10px 10px 10px 5px;font-size: 12px">
<img src="/logo.png" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${user.company_id.name}" />
</td>
</tr></tbody>
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">
<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">
<span style="font-size: 10px;">Your Account</span><br/>
<span style="font-size: 20px; font-weight: bold;">
${object.name}
</span>
</td><td valign="middle" align="right">
<img src="/logo.png?company=${object.company_id.id}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${object.company_id.name}"/>
</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;">
<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="top" style="font-size: 13px;">
<div>
Dear ${object.name},<br/><br/>
Your account has been successfully created!<br/>
Your login is <strong>${object.email}</strong><br/>
To gain access to your account, you can use the following link:
<div style="margin: 16px 0px 16px 0px;">
<a href="/web/login?${ctx['auth_login']}"
style="background-color: #875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;">
Go to My Account
</a>
</div>
Thanks,<br/><br />
${user.signature | safe}<br/>
</div>
</td></tr>
<tr><td 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>
<!-- FOOTER -->
<tr>
<td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;">
<tr><td valign="middle" align="left">
${object.company_id.name}
</td></tr>
<tr><td valign="middle" align="left" style="opacity: 0.7;">
${object.company_id.phone}
% if object.company_id.email
| <a href="'mailto:%s' % ${object.company_id.email}" style="text-decoration:none; color: #454748;">${object.company_id.email}</a>
% endif
% if object.company_id.website
| <a href="'%s' % ${object.company_id.website}" style="text-decoration:none; color: #454748;">
${object.company_id.website}
</a>
% endif
</td></tr>
</table>
</td>
</tr>
</tbody>
</table>
</td></tr>
<!-- POWERED BY -->
<tr><td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;">
<tr><td style="text-align: center; font-size: 13px;">
Powered by <a target="_blank" href="https://www.odoo.com" style="color: #875A7B;">Odoo</a>
</td></tr>
</table>
</div>
<div style="padding:0px;width:600px;margin:auto;background: #FFFFFF repeat top /100%;color:#777777">
<p>Dear ${object.name},</p>
<p>
Your account has been successfully created!
</p>
<p>
Your login: ${object.email}
<br/>
</p>
<p>
To gain access to your account, you can use the following link:
</p>
<div style="text-align: center; margin-top: 16px;">
<a href="/web/login?${ctx['auth_login']}" style="padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#875A7B; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px">Go to My Account</a>
</div>
<p>Best regards,</p>
</div>
<div style="padding:0px;width:600px;margin:auto; margin-top: 10px; background: #fff repeat top /100%;color:#777777">
${user.signature | safe}
<p style="font-size: 11px; margin-top: 10px;">
<strong>Sent by ${user.company_id.name} using <a href="www.odoo.com" style="text-decoration:none; color: #875A7B;">Odoo</a></strong>
</p>
</div></field>
</td></tr>
</table></field>
<field name="auto_delete" eval="True"/>
<field name="user_signature" eval="False"/>
</record>
+1
View File
@@ -28,6 +28,7 @@ If you need to manage your meetings, you should install the CRM module.
'security/calendar_security.xml',
'data/calendar_cron.xml',
'data/calendar_data.xml',
'data/mail_data.xml',
'views/mail_activity_views.xml',
'views/calendar_templates.xml',
'views/calendar_views.xml',
+1 -278
View File
@@ -1,8 +1,6 @@
<?xml version="1.0"?>
<odoo>
<data noupdate="1">
<!-- Expense-related subtypes for messaging / Chatter -->
<record id="calendar.subtype_invitation" model="mail.message.subtype">
<field name="name">Invitation</field>
<field name="res_model">calendar.event</field>
@@ -51,280 +49,5 @@
<field name="interval">hours</field>
<field name="type">email</field>
</record>
<record id="calendar_template_meeting_invitation" model="mail.template">
<field name="name">Calendar: Meeting Invitation</field>
<field name="email_from">${object.event_id.user_id.email or ''}</field>
<field name="subject">${object.event_id.name} invitation</field>
<field name="model_id" ref="calendar.model_calendar_attendee"/>
<field name="email_to" >${('' if object.partner_id and object.partner_id.email and object.partner_id.email==object.email else object.email|safe)}</field>
<field name="partner_to">${object.partner_id and object.partner_id.email and object.partner_id.email==object.email and object.partner_id.id or False }</field>
<field name="auto_delete" eval="True"/>
<field name="body_html"><![CDATA[
<div summary="o_mail_template" style="padding:0px;width:600px;margin:auto;background: #FFFFFF repeat top /100%;color:#777777">
% set colors = {'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'}
<table cellspacing="0" cellpadding="0" style="width:600px;border-collapse:collapse;background:inherit;color:inherit">
<tbody><tr>
<td valign="center" width="200" style="padding:10px 10px 10px 5px;font-size: 12px">
<img src="/logo.png" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${user.company_id.name}">
</td>
<td valign="center" align="right" width="340" style="padding:10px 10px 10px 5px; font-size: 12px;">
<p>
<a href="/calendar/meeting/accept?db=${'dbname' in ctx and ctx['dbname'] or ''}&token=${object.access_token}&action=${'action_id' in ctx and ctx['action_id'] or ''}&id=${object.event_id.id}" style="padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#875A7B; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px">Accept</a>
<a href="/calendar/meeting/decline?db=${'dbname' in ctx and ctx['dbname'] or '' }&token=${object.access_token}&action=${'action_id' in ctx and ctx['action_id'] or ''}&id=${object.event_id.id}" style="padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#875A7B; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px">Decline</a>
<a href="/calendar/meeting/view?db=${'dbname' in ctx and ctx['dbname'] or ''}&token=${object.access_token}&action=${'action_id' in ctx and ctx['action_id'] or ''}&id=${object.event_id.id}" style="padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#875A7B; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px">View</a>
</p>
</td>
</tr></tbody>
</table>
<table cellspacing="0" cellpadding="0" style="width:600px;border-collapse:collapse;background:inherit;color:inherit">
<tbody><tr>
<td valign="top" style="width:600px; padding:10px 10px 10px 5px;">
<div>
<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:15px auto;padding:0">
</div>
</td>
</tr></tbody>
</table>
</div>
<div style="padding:0px;width:600px;margin:auto;background: #FFFFFF repeat top /100%;color:#777777">
<table cellspacing="0" cellpadding="0" style="width:600px;border-collapse:collapse;background:inherit;color:inherit">
<tbody><tr>
<td style="padding:10px 10px 10px 5px;font-size: 14px;">
<p style="font-size: 20px; text-align: center;">Invitation to <strong>${object.event_id.name}</strong></p>
<p>
<strong>Dear ${object.common_name}</strong>,<br />
${object.event_id.user_id.partner_id.name} invited you for the ${object.event_id.name} meeting of ${object.event_id.user_id.company_id.name}.</p>
<table style="margin-top: 20px;"><tr>
<td>
<div style="border-top-left-radius:3px;border-top-right-radius:3px;font-size:12px;border-collapse:separate;text-align:center;font-weight:bold;color:#ffffff;width:130px;min-height: 18px;background:#875A7B;padding-top: 4px;border:1px solid #875A7B;">
${object.event_id.get_interval('dayname', tz=object.partner_id.tz if not object.event_id.allday else None)}
</div>
<div style="font-size:48px;min-height:auto;font-weight:bold;text-align:center;color: #5F5F5F;background-color: #F8F8F8;width: 130px;border:1px solid #875A7B;">
${object.event_id.get_interval('day', tz=object.partner_id.tz if not object.event_id.allday else None)}
</div>
<div style='font-size:12px;text-align:center;font-weight:bold;color:#ffffff;background-color:#875A7B'>${object.event_id.get_interval('month', tz=object.partner_id.tz if not object.event_id.allday else None)}</div>
<div style="border-collapse:separate;color: #5F5F5F;text-align:center;width: 130px;font-size:12px;border-bottom-right-radius:3px;font-weight:bold;border:1px solid #875A7B;border-bottom-left-radius:3px;">${not object.event_id.allday and object.event_id.get_interval('time', tz=object.partner_id.tz) or ''}</div>
</td>
<td width="20px;"/>
<td>
<p>Details of the event</p>
<ul>
% if object.event_id.location:
<li>Location: ${object.event_id.location}
(<a target="_blank" href="http://maps.google.com/maps?oi=map&q=${object.event_id.location}">View Map</a>)
</li>
% endif
% if object.event_id.description :
<li>Description: ${object.event_id.description}</li>
% endif
% if not object.event_id.allday and object.event_id.duration
<li>Duration: ${('%dH%02d' % (object.event_id.duration,(object.event_id.duration*60)%60))}</li>
% endif
<li>Attendees
<ul>
% for attendee in object.event_id.attendee_ids:
<li>
<div style="display:inline-block; border-radius: 50%; width:10px; height:10px;background:${colors[attendee.state] or 'white'};"></div>
% if attendee.common_name != object.common_name:
<span style="margin-left:5px">${attendee.common_name}</span>
% else:
<span style="margin-left:5px">You</span>
% endif
</li>
% endfor
</ul></li>
</ul>
</td>
</tr></table>
</td>
</tr></tbody>
</table>
</div>]]></field>
</record>
<record id="calendar_template_meeting_changedate" model="mail.template">
<field name="name">Calendar: Date updated</field>
<field name="email_from">${object.event_id.user_id.email or ''}</field>
<field name="subject">${object.event_id.name}: Date updated</field>
<field name="model_id" ref="calendar.model_calendar_attendee"/>
<field name="email_to" >${('' if object.partner_id and object.partner_id.email and object.partner_id.email==object.email else object.email|safe)}</field>
<field name="partner_to">${object.partner_id and object.partner_id.email and object.partner_id.email==object.email and object.partner_id.id or False }</field>
<field name="auto_delete" eval="True"/>
<field name="body_html"><![CDATA[
<div summary="o_mail_template" style="padding:0px;width:600px;margin:auto;background: #FFFFFF repeat top /100%;color:#777777">
% set colors = {'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'}
<table cellspacing="0" cellpadding="0" style="width:600px;border-collapse:collapse;background:inherit;color:inherit">
<tbody><tr>
<td valign="center" width="200" style="padding:10px 10px 10px 5px;font-size: 12px">
<img src="/logo.png" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${user.company_id.name}">
</td>
<td valign="center" align="right" width="340" style="padding:10px 10px 10px 5px; font-size: 12px;">
<p>
<a href="/calendar/meeting/accept?db=${'dbname' in ctx and ctx['dbname'] or ''}&token=${object.access_token}&action=${'action_id' in ctx and ctx['action_id'] or ''}&id=${object.event_id.id}" style="padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#875A7B; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px">Accept</a>
<a href="/calendar/meeting/decline?db=${'dbname' in ctx and ctx['dbname'] or '' }&token=${object.access_token}&action=${'action_id' in ctx and ctx['action_id'] or ''}&id=${object.event_id.id}" style="padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#875A7B; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px">Decline</a>
<a href="/calendar/meeting/view?db=${'dbname' in ctx and ctx['dbname'] or ''}&token=${object.access_token}&action=${'action_id' in ctx and ctx['action_id'] or ''}&id=${object.event_id.id}" style="padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#875A7B; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px">View</a>
</p>
</td>
</tr></tbody>
</table>
<table cellspacing="0" cellpadding="0" style="width:600px;border-collapse:collapse;background:inherit;color:inherit">
<tbody><tr>
<td valign="top" style="width:600px; padding:10px 10px 10px 5px;">
<div>
<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:15px auto;padding:0">
</div>
</td>
</tr></tbody>
</table>
</div>
<div style="padding:0px;width:600px;margin:auto;background: #FFFFFF repeat top /100%;color:#777777">
<table cellspacing="0" cellpadding="0" style="width:600px;border-collapse:collapse;background:inherit;color:inherit">
<tbody><tr>
<td style="padding:10px 10px 10px 5px;font-size: 14px;">
<p style="font-size: 20px; text-align: center;"><strong>${object.event_id.name} date updated</strong></p>
<p>
<strong>Dear ${object.common_name}</strong>,<br />
The date of the meeting has been upated. The meeting ${object.event_id.name} created by ${object.event_id.user_id.partner_id.name} is now scheduled for ${object.event_id.get_display_time_tz(tz=object.partner_id.tz)}.
</p>
<table style="margin-top: 20px;"><tr>
<td>
<div style="border-top-left-radius:3px;border-top-right-radius:3px;font-size:12px;border-collapse:separate;text-align:center;font-weight:bold;color:#ffffff;width:130px;min-height: 18px;background:#875A7B;padding-top: 4px;">
${object.event_id.get_interval('dayname', tz=object.partner_id.tz if not object.event_id.allday else None)}
</div>
<div style="font-size:48px;min-height:auto;font-weight:bold;text-align:center;color: #5F5F5F;background-color: #F8F8F8;width: 130px;border:1px solid #875A7B;">
${object.event_id.get_interval('day', tz=object.partner_id.tz if not object.event_id.allday else None)}
</div>
<div style='font-size:12px;text-align:center;font-weight:bold;color:#ffffff;background-color:#875A7B'>${object.event_id.get_interval('month', tz=object.partner_id.tz if not object.event_id.allday else None)}</div>
<div style="border-collapse:separate;color: #5F5F5F;text-align:center;width: 130px;font-size:12px;border-bottom-right-radius:3px;font-weight:bold;border:1px solid #875A7B;border-bottom-left-radius:3px;">${not object.event_id.allday and object.event_id.get_interval('time', tz=object.partner_id.tz) or ''}</div>
</td>
<td width="20px;"/>
<td>
<p>Details of the event</p>
<ul>
% if object.event_id.location:
<li>Location: ${object.event_id.location}
(<a target="_blank" href="http://maps.google.com/maps?oi=map&q=${object.event_id.location}">View Map</a>)
</li>
% endif
% if object.event_id.description :
<li>Description: ${object.event_id.description}</li>
% endif
% if not object.event_id.allday and object.event_id.duration
<li>Duration: ${('%dH%02d' % (object.event_id.duration,(object.event_id.duration*60)%60))}</li>
% endif
<li>Attendees
<ul>
% for attendee in object.event_id.attendee_ids:
<li>
<div style="display:inline-block; border-radius: 50%; width:10px; height:10px;background:${colors[attendee.state] or 'white'};"></div>
% if attendee.common_name != object.common_name:
<span style="margin-left:5px">${attendee.common_name}</span>
% else:
<span style="margin-left:5px">You</span>
% endif
</li>
% endfor
</ul></li>
</ul>
</td>
</tr></table>
</td>
</tr></tbody>
</table>
</div>]]></field>
</record>
<record id="calendar_template_meeting_reminder" model="mail.template">
<field name="name">Calendar: Reminder</field>
<field name="email_from">${object.event_id.user_id.email or ''}</field>
<field name="subject">${object.event_id.name} - Reminder</field>
<field name="model_id" ref="calendar.model_calendar_attendee"/>
<field name="email_to" >${('' if object.partner_id and object.partner_id.email and object.partner_id.email==object.email else object.email|safe)}</field>
<field name="partner_to">${object.partner_id and object.partner_id.email and object.partner_id.email==object.email and object.partner_id.id or False }</field>
<field name="auto_delete" eval="True"/>
<field name="body_html"><![CDATA[
<div summary="o_mail_template" style="padding:0px;width:600px;margin:auto;background: #FFFFFF repeat top /100%;color:#777777">
% set colors = {'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'}
<table cellspacing="0" cellpadding="0" style="width:600px;border-collapse:collapse;background:inherit;color:inherit">
<tbody><tr>
<td valign="center" width="200" style="padding:10px 10px 10px 5px;font-size: 12px">
<img src="/logo.png" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${user.company_id.name}">
</td>
<td valign="center" align="right" width="340" style="padding:10px 10px 10px 5px; font-size: 12px;">
<p>
<a href="/calendar/meeting/accept?db=${'dbname' in ctx and ctx['dbname'] or ''}&token=${object.access_token}&action=${'action_id' in ctx and ctx['action_id'] or ''}&id=${object.event_id.id}" style="padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#875A7B; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px">Accept</a>
<a href="/calendar/meeting/decline?db=${'dbname' in ctx and ctx['dbname'] or '' }&token=${object.access_token}&action=${'action_id' in ctx and ctx['action_id'] or ''}&id=${object.event_id.id}" style="padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#875A7B; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px">Decline</a>
<a href="/calendar/meeting/view?db=${'dbname' in ctx and ctx['dbname'] or ''}&token=${object.access_token}&action=${'action_id' in ctx and ctx['action_id'] or ''}&id=${object.event_id.id}" style="padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#875A7B; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px">View</a>
</p>
</td>
</tr></tbody>
</table>
<table cellspacing="0" cellpadding="0" style="width:600px;border-collapse:collapse;background:inherit;color:inherit">
<tbody><tr>
<td valign="top" style="width:600px; padding:10px 10px 10px 5px;">
<div>
<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:15px auto;padding:0">
</div>
</td>
</tr></tbody>
</table>
</div>
<div style="padding:0px;width:600px;margin:auto;background: #FFFFFF repeat top /100%;color:#777777">
<table cellspacing="0" cellpadding="0" style="width:600px;border-collapse:collapse;background:inherit;color:inherit">
<tbody><tr>
<td style="padding:10px 10px 10px 5px;font-size: 14px;">
<p style="font-size: 20px; text-align: center;">Reminder for <strong>${object.event_id.name}</strong></p>
<p>
<strong>Dear ${object.common_name}</strong>,<br />
This is a reminder for the below event :
</p>
<table style="margin-top: 20px;"><tr>
<td>
<div style="border-top-left-radius:3px;border-top-right-radius:3px;font-size:12px;border-collapse:separate;text-align:center;font-weight:bold;color:#ffffff;width:130px;min-height: 18px;background:#875A7B;padding-top: 4px;">
${object.event_id.get_interval('dayname', tz=object.partner_id.tz if not object.event_id.allday else None)}
</div>
<div style="font-size:48px;min-height:auto;font-weight:bold;text-align:center;color: #5F5F5F;background-color: #F8F8F8;width: 130px;border:1px solid #875A7B;">
${object.event_id.get_interval('day', tz=object.partner_id.tz if not object.event_id.allday else None)}
</div>
<div style='font-size:12px;text-align:center;font-weight:bold;color:#ffffff;background-color:#875A7B'>${object.event_id.get_interval('month', tz=object.partner_id.tz if not object.event_id.allday else None)}</div>
<div style="border-collapse:separate;color: #5F5F5F;text-align:center;width: 130px;font-size:12px;border-bottom-right-radius:3px;font-weight:bold;border:1px solid #875A7B;border-bottom-left-radius:3px;">${not object.event_id.allday and object.event_id.get_interval('time', tz=object.partner_id.tz) or ''}</div>
</td>
<td width="20px;"/>
<td>
<p>Details of the event</p>
<ul>
% if object.event_id.location:
<li>Location: ${object.event_id.location}
(<a target="_blank" href="http://maps.google.com/maps?oi=map&q=${object.event_id.location}">View Map</a>)
</li>
% endif
% if object.event_id.description :
<li>Description: ${object.event_id.description}</li>
% endif
% if not object.event_id.allday and object.event_id.duration
<li>Duration: ${('%dH%02d' % (object.event_id.duration,(object.event_id.duration*60)%60))}</li>
% endif
<li>Attendees
<ul>
% for attendee in object.event_id.attendee_ids:
<li>
<div style="display:inline-block; border-radius: 50%; width:10px; height:10px;background:${colors[attendee.state] or 'white'};"></div>
% if attendee.common_name != object.common_name:
<span style="margin-left:5px">${attendee.common_name}</span>
% else:
<span style="margin-left:5px">You</span>
% endif
</li>
% endfor
</ul></li>
</ul>
</td>
</tr></table>
</td>
</tr></tbody>
</table>
</div>]]></field>
</record>
</data>
</odoo>
</odoo>
+253
View File
@@ -0,0 +1,253 @@
<?xml version="1.0"?>
<odoo>
<data noupdate="1">
<record id="calendar_template_meeting_invitation" model="mail.template">
<field name="name">Calendar: Meeting Invitation</field>
<field name="model_id" ref="calendar.model_calendar_attendee"/>
<field name="subject">Invitation to ${object.event_id.name}</field>
<field name="email_from">${object.event_id.user_id.email or ''}</field>
<field name="email_to" >${('' if object.partner_id and object.partner_id.email and object.partner_id.email==object.email else object.email|safe)}</field>
<field name="partner_to">${object.partner_id and object.partner_id.email and object.partner_id.email==object.email and object.partner_id.id or False }</field>
<field name="body_html" type="html">
<div>
% set colors = {'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'}
<p>
Hello ${object.common_name},<br/><br/>
${object.event_id.user_id.partner_id.name} invited you for the ${object.event_id.name} meeting of ${object.event_id.user_id.company_id.name}.
</p>
<div style="text-align: center; margin: 16px 0px 16px 0px;">
<a href="/calendar/meeting/accept?db=${'dbname' in ctx and ctx['dbname'] or ''}&amp;token=${object.access_token}&amp;action=${'action_id' in ctx and ctx['action_id'] or ''}&amp;id=${object.event_id.id}"
style="padding: 5px 10px; color: #FFFFFF; text-decoration: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius: 3px">
Accept</a>
<a href="/calendar/meeting/decline?db=${'dbname' in ctx and ctx['dbname'] or '' }&amp;token=${object.access_token}&amp;action=${'action_id' in ctx and ctx['action_id'] or ''}&amp;id=${object.event_id.id}"
style="padding: 5px 10px; color: #FFFFFF; text-decoration: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius: 3px">
Decline</a>
<a href="/calendar/meeting/view?db=${'dbname' in ctx and ctx['dbname'] or ''}&amp;token=${object.access_token}&amp;action=${'action_id' in ctx and ctx['action_id'] or ''}&amp;id=${object.event_id.id}"
style="padding: 5px 10px; color: #FFFFFF; text-decoration: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius: 3px">
View</a>
</div>
<table border="0" cellpadding="0" cellspacing="0"><tr>
<td width="130px;">
<div style="border-top-left-radius: 3px; border-top-right-radius: 3px; font-size: 12px; border-collapse: separate; text-align: center; font-weight: bold; color: #ffffff; min-height: 18px; background-color: #875A7B; border: 1px solid #875A7B;">
${object.event_id.get_interval('dayname', tz=object.partner_id.tz if not object.event_id.allday else None)}
</div>
<div style="font-size: 48px; min-height: auto; font-weight: bold; text-align: center; color: #5F5F5F; background-color: #F8F8F8; border: 1px solid #875A7B;">
${object.event_id.get_interval('day', tz=object.partner_id.tz if not object.event_id.allday else None)}
</div>
<div style='font-size: 12px; text-align: center; font-weight: bold; color: #ffffff; background-color: #875A7B;'>
${object.event_id.get_interval('month', tz=object.partner_id.tz if not object.event_id.allday else None)}
</div>
<div style="border-collapse: separate; color: #5F5F5F; text-align: center; font-size: 12px; border-bottom-right-radius: 3px; font-weight: bold; border: 1px solid #875A7B; border-bottom-left-radius: 3px;">
${not object.event_id.allday and object.event_id.get_interval('time', tz=object.partner_id.tz) or ''}
</div>
</td>
<td width="20px;"/>
<td style="padding-top: 5px;">
<p><strong>Details of the event</strong></p>
<ul>
% if object.event_id.location:
<li>Location: ${object.event_id.location}
(<a target="_blank" href="http://maps.google.com/maps?oi=map&amp;q=${object.event_id.location}">View Map</a>)
</li>
% endif
% if object.event_id.description :
<li>Description: ${object.event_id.description}</li>
% endif
% if not object.event_id.allday and object.event_id.duration
<li>Duration: ${('%dH%02d' % (object.event_id.duration,(object.event_id.duration*60)%60))}</li>
% endif
<li>Attendees
<ul>
% for attendee in object.event_id.attendee_ids:
<li>
<div style="display: inline-block; border-radius: 50%; width: 10px; height: 10px; background:${colors[attendee.state] or 'white'};"> </div>
% if attendee.common_name != object.common_name:
<span style="margin-left:5px">${attendee.common_name}</span>
% else:
<span style="margin-left:5px">You</span>
% endif
</li>
% endfor
</ul></li>
</ul>
</td>
</tr></table>
<br/>
Thank you,
<br/>
% if object.event_id.user_id and object.event_id.user_id.signature:
${object.event_id.user_id.signature | safe}
% endif
</div>
</field>
<field name="auto_delete" eval="True"/>
<field name="user_signature" eval="False"/>
</record>
<record id="calendar_template_meeting_changedate" model="mail.template">
<field name="name">Calendar: Date updated</field>
<field name="model_id" ref="calendar.model_calendar_attendee"/>
<field name="subject">${object.event_id.name}: Date updated</field>
<field name="email_from">${object.event_id.user_id.email or ''}</field>
<field name="email_to" >${('' if object.partner_id and object.partner_id.email and object.partner_id.email==object.email else object.email|safe)}</field>
<field name="partner_to">${object.partner_id and object.partner_id.email and object.partner_id.email==object.email and object.partner_id.id or False }</field>
<field name="body_html" type="html">
<div>
% set colors = {'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'}
<p>
Hello ${object.common_name},<br/><br/>
The date of the meeting has been updated. The meeting ${object.event_id.name} created by ${object.event_id.user_id.partner_id.name} is now scheduled for ${object.event_id.get_display_time_tz(tz=object.partner_id.tz)}.
</p>
<div style="text-align: center; margin: 16px 0px 16px 0px;">
<a href="/calendar/meeting/accept?db=${'dbname' in ctx and ctx['dbname'] or ''}&amp;token=${object.access_token}&amp;action=${'action_id' in ctx and ctx['action_id'] or ''}&amp;id=${object.event_id.id}"
style="padding: 5px 10px; color: #FFFFFF; text-decoration: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius: 3px">
Accept</a>
<a href="/calendar/meeting/decline?db=${'dbname' in ctx and ctx['dbname'] or '' }&amp;token=${object.access_token}&amp;action=${'action_id' in ctx and ctx['action_id'] or ''}&amp;id=${object.event_id.id}"
style="padding: 5px 10px; color: #FFFFFF; text-decoration: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius: 3px">
Decline</a>
<a href="/calendar/meeting/view?db=${'dbname' in ctx and ctx['dbname'] or ''}&amp;token=${object.access_token}&amp;action=${'action_id' in ctx and ctx['action_id'] or ''}&amp;id=${object.event_id.id}"
style="padding: 5px 10px; color: #FFFFFF; text-decoration: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius: 3px">
View</a>
</div>
<table border="0" cellpadding="0" cellspacing="0"><tr>
<td width="130px;">
<div style="border-top-left-radius: 3px; border-top-right-radius: 3px; font-size: 12px; border-collapse: separate; text-align: center; font-weight: bold; color: #ffffff; min-height: 18px; background-color: #875A7B; border: 1px solid #875A7B;">
${object.event_id.get_interval('dayname', tz=object.partner_id.tz if not object.event_id.allday else None)}
</div>
<div style="font-size: 48px; min-height: auto; font-weight: bold; text-align: center; color: #5F5F5F; background-color: #F8F8F8; border: 1px solid #875A7B;">
${object.event_id.get_interval('day', tz=object.partner_id.tz if not object.event_id.allday else None)}
</div>
<div style='font-size: 12px; text-align: center; font-weight: bold; color: #ffffff; background-color: #875A7B;'>
${object.event_id.get_interval('month', tz=object.partner_id.tz if not object.event_id.allday else None)}
</div>
<div style="border-collapse: separate; color: #5F5F5F; text-align: center; font-size: 12px; border-bottom-right-radius: 3px; font-weight: bold; border: 1px solid #875A7B; border-bottom-left-radius: 3px;">
${not object.event_id.allday and object.event_id.get_interval('time', tz=object.partner_id.tz) or ''}
</div>
</td>
<td width="20px;"/>
<td style="padding-top: 5px;">
<p><strong>Details of the event</strong></p>
<ul>
% if object.event_id.location:
<li>Location: ${object.event_id.location}
(<a target="_blank" href="http://maps.google.com/maps?oi=map&amp;q=${object.event_id.location}">View Map</a>)
</li>
% endif
% if object.event_id.description :
<li>Description: ${object.event_id.description}</li>
% endif
% if not object.event_id.allday and object.event_id.duration
<li>Duration: ${('%dH%02d' % (object.event_id.duration,(object.event_id.duration*60)%60))}</li>
% endif
<li>Attendees
<ul>
% for attendee in object.event_id.attendee_ids:
<li>
<div style="display: inline-block; border-radius: 50%; width: 10px; height: 10px; background: ${colors[attendee.state] or 'white'};"> </div>
% if attendee.common_name != object.common_name:
<span style="margin-left:5px">${attendee.common_name}</span>
% else:
<span style="margin-left:5px">You</span>
% endif
</li>
% endfor
</ul></li>
</ul>
</td>
</tr></table>
<br/>
Thank you,
<br/>
% if object.event_id.user_id and object.event_id.user_id.signature:
${object.event_id.user_id.signature | safe}
% endif
</div>
</field>
<field name="auto_delete" eval="True"/>
<field name="user_signature" eval="False"/>
</record>
<record id="calendar_template_meeting_reminder" model="mail.template">
<field name="name">Calendar: Reminder</field>
<field name="model_id" ref="calendar.model_calendar_attendee"/>
<field name="subject">${object.event_id.name} - Reminder</field>
<field name="email_from">${object.event_id.user_id.email or ''}</field>
<field name="email_to" >${('' if object.partner_id and object.partner_id.email and object.partner_id.email==object.email else object.email|safe)}</field>
<field name="partner_to">${object.partner_id and object.partner_id.email and object.partner_id.email==object.email and object.partner_id.id or False }</field>
<field name="body_html" type="html">
<div>
% set colors = {'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'}
<p>
Hello ${object.common_name},<br/><br/>
This is a reminder for the below event :
</p>
<div style="text-align: center; margin: 16px 0px 16px 0px;">
<a href="/calendar/meeting/accept?db=${'dbname' in ctx and ctx['dbname'] or ''}&amp;token=${object.access_token}&amp;action=${'action_id' in ctx and ctx['action_id'] or ''}&amp;id=${object.event_id.id}"
style="padding: 5px 10px; color: #FFFFFF; text-decoration: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius: 3px">
Accept</a>
<a href="/calendar/meeting/decline?db=${'dbname' in ctx and ctx['dbname'] or '' }&amp;token=${object.access_token}&amp;action=${'action_id' in ctx and ctx['action_id'] or ''}&amp;id=${object.event_id.id}"
style="padding: 5px 10px; color: #FFFFFF; text-decoration: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius: 3px">
Decline</a>
<a href="/calendar/meeting/view?db=${'dbname' in ctx and ctx['dbname'] or ''}&amp;token=${object.access_token}&amp;action=${'action_id' in ctx and ctx['action_id'] or ''}&amp;id=${object.event_id.id}"
style="padding: 5px 10px; color: #FFFFFF; text-decoration: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius: 3px">
View</a>
</div>
<table border="0" cellpadding="0" cellspacing="0"><tr>
<td width="130px;">
<div style="border-top-left-radius: 3px; border-top-right-radius: 3px; font-size: 12px; border-collapse: separate; text-align: center; font-weight: bold; color: #ffffff; min-height: 18px; background-color: #875A7B; border: 1px solid #875A7B;">
${object.event_id.get_interval('dayname', tz=object.partner_id.tz if not object.event_id.allday else None)}
</div>
<div style="font-size: 48px; min-height: auto; font-weight: bold; text-align: center; color: #5F5F5F; background-color: #F8F8F8; border: 1px solid #875A7B;">
${object.event_id.get_interval('day', tz=object.partner_id.tz if not object.event_id.allday else None)}
</div>
<div style='font-size: 12px; text-align: center; font-weight: bold; color: #ffffff; background-color: #875A7B;'>
${object.event_id.get_interval('month', tz=object.partner_id.tz if not object.event_id.allday else None)}
</div>
<div style="border-collapse: separate; color: #5F5F5F; text-align: center; font-size: 12px; border-bottom-right-radius: 3px; font-weight: bold; border: 1px solid #875A7B; border-bottom-left-radius: 3px;">
${not object.event_id.allday and object.event_id.get_interval('time', tz=object.partner_id.tz) or ''}
</div>
</td>
<td width="20px;"/>
<td style="padding-top: 5px;">
<p><strong>Details of the event</strong></p>
<ul>
% if object.event_id.location:
<li>Location: ${object.event_id.location}
(<a target="_blank" href="http://maps.google.com/maps?oi=map&amp;q=${object.event_id.location}">View Map</a>)
</li>
% endif
% if object.event_id.description :
<li>Description: ${object.event_id.description}</li>
% endif
% if not object.event_id.allday and object.event_id.duration
<li>Duration: ${('%dH%02d' % (object.event_id.duration,(object.event_id.duration*60)%60))}</li>
% endif
<li>Attendees
<ul>
% for attendee in object.event_id.attendee_ids:
<li>
<div style="display: inline-block; border-radius: 50%; width: 10px; height: 10px; background:${colors[attendee.state] or 'white'};"> </div>
% if attendee.common_name != object.common_name:
<span style="margin-left:5px">${attendee.common_name}</span>
% else:
<span style="margin-left:5px">You</span>
% endif
</li>
% endfor
</ul></li>
</ul>
</td>
</tr></table>
<br/>
Thank you,
<br/>
% if object.event_id.user_id and object.event_id.user_id.signature:
${object.event_id.user_id.signature | safe}
% endif
</div>
</field>
<field name="auto_delete" eval="True"/>
<field name="user_signature" eval="False"/>
</record>
</data>
</odoo>
+2 -2
View File
@@ -111,7 +111,7 @@ class Attendee(models.Model):
_name = 'calendar.attendee'
_rec_name = 'common_name'
_description = 'Attendee information'
_description = 'Calendar Registration'
def _default_access_token(self):
return uuid.uuid4().hex
@@ -195,7 +195,7 @@ class Attendee(models.Model):
if attendee.email or attendee.partner_id.email:
# FIXME: is ics_file text or bytes?
ics_file = ics_files.get(attendee.event_id.id)
mail_id = invitation_template.send_mail(attendee.id)
mail_id = invitation_template.send_mail(attendee.id, notif_layout='mail.mail_notification_light')
vals = {}
if ics_file:
-16
View File
@@ -71,22 +71,6 @@
<field name="email_to">${(not object.partner_id and object.email_from)|safe}</field>
<field name="body_html"></field>
</record>
<record id="email_template_opportunity_reminder_mail" model="mail.template">
<field name="name">Lead: Reminder</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="auto_delete" eval="True"/>
<field name="email_from">admin@example.com</field>
<field name="email_to">${(object.user_id != False and object.user_id.email)|safe}</field>
<field name="subject">Reminder: Lead ${object.name} from ${object.partner_id != False and object.partner_id.name or object.contact_name}</field>
<field name="body_html"><![CDATA[
<p>Hello ${object.user_id and object.user_id.name or ''},</p>
<p>The opportunity <strong>${object.name}</strong> did not have any activity since at least 5 days.</p>
%if object.description:
<p>Here is the description about the opportunity : </p><p><i>${object.description}</i>
%endif
</p><p>Thank you!</p>
]]></field>
</record>
</data>
</odoo>
+35 -26
View File
@@ -1,30 +1,39 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>
<data noupdate="1">
<odoo><data noupdate="1">
<record id="mail_template_data_delivery_confirmation" model="mail.template">
<field name="name">Delivery: Send by Email</field>
<field name="subject">${object.company_id.name} Delivery Order (Ref ${object.name or 'n/a' })</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="model_id" ref="delivery.model_stock_picking"/>
<field name="report_template" ref="stock.action_report_delivery"/>
<field name="report_name">${(object.name or '').replace('/','_')}</field>
<field name="lang">${object.partner_id.lang}</field>
<field name="body_html" type="xml">
<p>Dear ${object.partner_id.name},</p>
<p>We are glad to inform you that your order has been shipped.</p>
<p>
%if object.carrier_tracking_ref:
Your tracking reference:
%if object.carrier_tracking_url:
<a href="${object.carrier_tracking_url}" target="_blank">${object.carrier_tracking_ref}</a>.
%else:
${object.carrier_tracking_ref}.
%endif
%endif
</p>
<p>Find your delivery order attached for more details.</p>
<p>Thank you,</p>
</field>
<field name="name">Delivery: Send by Email</field>
<field name="model_id" ref="delivery.model_stock_picking"/>
<field name="subject">${object.company_id.name} Delivery Order (Ref ${object.name or 'n/a' })</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
Hello ${object.partner_id.name},<br/><br/>
We are glad to inform you that your order has been shipped.
%if object.carrier_tracking_ref:
Your tracking reference is
<strong>
%if object.carrier_tracking_url:
<a href="${object.carrier_tracking_url}" target="_blank">${object.carrier_tracking_ref}</a>.
%else:
${object.carrier_tracking_ref}.
%endif
</strong>
%endif
<br/><br/>
Please find your delivery order attached for more details.<br/><br/>
Thank you,<br/>
% if user and user.signature:
${user.signature | safe}
% endif
</p>
</div>
</field>
<field name="report_template" ref="stock.action_report_delivery"/>
<field name="report_name">${(object.name or '').replace('/','_')}</field>
<field name="lang">${object.partner_id.lang}</field>
<field name="auto_delete" eval="True"/>
<field name="user_signature" eval="False"/>
</record>
</data>
</data>
</odoo>
+1 -1
View File
@@ -141,7 +141,7 @@ class StockPicking(models.Model):
default_model='stock.picking',
default_use_template=bool(delivery_template_id),
default_template_id=delivery_template_id,
custom_layout='mail.mail_notification_borders'
custom_layout='mail.mail_notification_light'
)
return {
'type': 'ir.actions.act_window',
+31 -3
View File
@@ -19,14 +19,42 @@
</record>
<record id="mail_template_data_unknown_employee_email_address" model="mail.template">
<field name="name">HR: unknown employee bounce</field>
<field name="name">HR: mailgateway unknown employee bounce</field>
<field name="model_id" ref="base.model_ir_module_module"/>
<field name="subject">Your document has not been created</field>
<field name="email_from">${user.email}</field>
<field name="email_to">${ctx['email_to']|safe}</field>
<field name="body_html" type="html">
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">
<tbody>
<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="top" style="font-size: 13px;">
<div>
Hi,<br/>
Your document has not been created because your email address is not recognized. Please send emails with the email address recorded on your employee information, or contact your HR manager.
</div>
</td></tr>
</table>
</td></tr>
</tbody>
</table>
</td></tr>
<!-- POWERED BY -->
<tr><td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;">
<tr><td style="text-align: center; font-size: 13px;">
Powered by <a target="_blank" href="https://www.odoo.com" style="color: #875A7B;">Odoo</a>
</td></tr>
</table>
</td></tr>
</table>
</field>
<field name="lang">${user.lang}</field>
<field name="model_id" ref="base.model_ir_module_module"/>
<field name="auto_delete" eval="True"/>
<field name="body_html" ><![CDATA[Your document has not been created because your email address is not recognized. Please send emails with the email address recorded on your employee information, or contact your HR manager.]]></field>
<field name="user_signature" eval="False"/>
</record>
</data>
+236 -355
View File
@@ -10,397 +10,278 @@
<!-- Templates for interest / refusing applicants -->
<record id="email_template_data_applicant_refuse" model="mail.template">
<field name="name">Applicant: Refuse</field>
<field name="model_id" ref="hr_recruitment.model_hr_applicant"/>
<field name="subject">Your Job Application: ${object.job_id.name | safe}</field>
<field name="email_to">${(not object.partner_id and object.email_from or '') | safe}</field>
<field name="partner_to">${object.partner_id.id or ''}</field>
<field name="lang">${object.partner_id.lang or ''}</field>
<field name="model_id" ref="hr_recruitment.model_hr_applicant"/>
<field name="user_signature" eval="False"/>
<field name="body_html"><![CDATA[
<div style="background-color:#F3F5F6;color:#515166;font-family:Arial,Helvetica,sans-serif;font-size:14px;">
<table style="width:600px;margin:10px auto;">
<tbody>
<tr>
<td>
<a href="/">
<img src="/logo" alt="${object.company_id.name}" style="vertical-align:baseline;max-width:100px;" />
</a>
</td>
<td style="text-align:right;vertical-align:middle;">
% if 'website_url' in object.job_id and object.job_id.website_url:
<a href="${object.job_id.website_url}" style="background-color: #1abc9c; padding: 12px; font-weight: 12px; text-decoration: none; color: #fff; border-radius: 5px; font-size:16px;">Job Description</a>
% endif
</td>
</tr>
</tbody>
</table>
<table style="width:600px;margin:0px auto;background-color:white;padding:8px; border:1px solid #e1e1e1;">
<tr>
<td style="font-size:16px; font-weight:300;">
<p style="font-size:16px;">
Hi,
</p><p style="font-size:16px;">
Thank you for your interest in joining the
<b>${object.company_id.name}</b> team. We wanted to
let you know that, although your resume is competitive,
our hiring team reviewed your application and <b>did not
select it for further consideration</b>.
</p><p style="font-size:16px;">
Please note that recruiting is hard, and we can do
mistake. Do not hesitate to reply to this email if you
think we did a mistake, or if you want more information
about our decision.
</p><p style="font-size:16px;">
We will, however, keep your resume on record and get in
touch with you about future opportunities that may be a
better fit for your skills and experience.
</p>
<p style="font-size:16px;">
We wish you all the best in your job search and hope we
will have the chance to consider you for another role
in the future.
</p>
<p style="font-size:16px;">
Regards,
</p>
<p style="color:grey;">-- <br/>
<field name="body_html" type="html">
<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="top">
<div style="font-size: 13px; margin: 0px; padding: 0px;">
Hello,<br/><br/>
Thank you for your interest in joining the
<b>${object.company_id.name}</b> team. We wanted to
let you know that, although your resume is competitive,
our hiring team reviewed your application and <b>did not
select it for further consideration</b>.
<br/><br/>
Please note that recruiting is hard, and we can do
mistake. Do not hesitate to reply to this email if you
think we did a mistake, or if you want more information
about our decision.
<br/><br/>
We will, however, keep your resume on record and get in
touch with you about future opportunities that may be a
better fit for your skills and experience.
<br/><br/>
We wish you all the best in your job search and hope we
will have the chance to consider you for another role
in the future.
<br/><br/>
Thank you,
<div style="font-size: 11px; color: grey;">
% if object.user_id:
-- <br/>
<strong>${object.user_id.name}</strong><br/>
Email: ${object.user_id.email or ''}<br/>
Phone: ${object.user_id.phone or ''}
% else:
-- <br/>
${object.company_id.name}<br/>
The HR Team
% endif
</p>
</td>
</tr>
</table>
<table style="width:600px;margin:0px auto;text-align:center;">
<tbody>
<tr>
<td style="padding-top:10px;font-size: 12px;">
<div>Sent by ${object.company_id.name}</div>
% if 'website_url' in object.job_id and object.job_id.website_url:
<div>
Discover <a href="/jobs" style="text-decoration:none;color:#717188;">our others jobs</a>.
</div>
% endif
</td>
</tr>
</tbody>
</table>
</div>
]]></field>
</div>
</div>
</td>
</tr>
</table>
</field>
<field name="user_signature" eval="False"/>
<field name="auto_delete" eval="True"/>
<field name="lang">${object.partner_id.lang or ''}</field>
</record>
<record id="email_template_data_applicant_interest" model="mail.template">
<field name="name">Applicant: Interest</field>
<field name="subject">Your Application: ${object.job_id.name | safe}</field>
<field name="model_id" ref="hr_recruitment.model_hr_applicant"/>
<field name="subject">Your Job Application: ${object.job_id.name | safe}</field>
<field name="email_to">${(not object.partner_id and object.email_from or '') | safe}</field>
<field name="partner_to">${object.partner_id.id or ''}</field>
<field name="lang">${object.partner_id.lang or ''}</field>
<field name="model_id" ref="hr_recruitment.model_hr_applicant"/>
<field name="user_signature" eval="False"/>
<field name="body_html"><![CDATA[
<div style="background-color:#F3F5F6;color:#515166;font-family:Arial,Helvetica,sans-serif;font-size:14px;">
<table style="width:600px;margin:10px auto;">
<tbody>
<tr>
<td>
<a href="/">
<img src="/logo" alt="${object.company_id.name}" style="vertical-align:baseline;max-width:100px;" />
</a>
</td>
<td style="text-align:right;vertical-align:middle;">
% if 'website_url' in object.job_id and object.job_id.website_url:
<a href="${object.job_id.website_url}" style="background-color: #1abc9c; padding: 12px; font-weight: 12px; text-decoration: none; color: #fff; border-radius: 5px; font-size:16px;">Job Description</a>
% endif
</td>
</tr>
</tbody>
</table>
<table style="width:600px;margin:0px auto;background-color:white;padding:8px;border:1px solid #e1e1e1;">
<tr>
<td style="font-size:16px; font-weight:300;">
<div style="text-align: center">
<h2>Congratulations!</h2>
<div style="color:grey;">Your resume has been positively reviewed.</div>
<img src="/hr_recruitment/static/src/img/congratulations.png" alt="Congratulations!" style="width:175px;margin:20px 0;"/>
</div>
<p style="font-size:16px;">
We just reviewed your resume, and it caught our
attention. As we think you might be great for the
position, your application has been short listed for a
call or an interview.
</p>
% if object.user_id:
<p style="font-size:16px;">
You will soon be contacted by:
</p>
<table style="width:100%; border:0px solid white;">
<tr>
<td width="75">
<img src="/web/image/res.users/${object.user_id.id}/image_small" alt="Avatar" style="vertical-align:baseline;max-width:64px;" />
</td><td style="font-size:15px;">
<strong>${object.user_id.name}</strong><br/>
<span>Email: ${object.user_id.email or ''}</span><br/>
<span>Phone: ${object.user_id.phone or ''}</span>
</td>
</tr>
</table>
% endif
<p style="font-size:16px;margin:24px 0;">
See you soon,
</p><p style="font-size:16px;color: grey;">
-- <br/>
Odoo HR Team
</p>
<hr style="margin: 30px 0"/>
<h3 style="color:#9A6C8E;"><strong>What is the next step?</strong></h3>
<p style="font-size:16px;">
We usually <strong>answer applications within 3 days</strong>.
The next step is either a call or a meeting in our offices.
</p><p style="font-size:16px;">
Feel free to <strong>contact us if you want a faster
feedback</strong> or if you don't get news from us
quickly enough (just reply to this email).
</p>
<hr style="margin: 30px 0"/>
<h3 style="color:#9A6C8E;"><strong>Want to learn about us?</strong></h3>
<ol>
<li><a style="color:#1CC5A9" href="https://www.odoo.com/blog/odoo-news-5/post/the-odoo-story-56">Founders' story</a></li>
<li><a style="color:#1CC5A9" href="https://www.slideshare.net/openobject/the-odoo-culture">The Odoo Culture</a></li>
<li><a style="color:#1CC5A9" href="https://www.odoo.com/page/about-us">About us</a></li>
</ol>
<hr style="margin: 30px 0"/>
% set location = ''
% if object.job_id.address_id.name:
<p style="margin:0px 0px 0px 0px;"><strong>${object.job_id.address_id.name}</strong></p>
% endif
% if object.job_id.address_id.street:
<p style="margin:0px 0px 0px 0px;">${object.job_id.address_id.street}</p>
% set location = object.job_id.address_id.street
% endif
% if object.job_id.address_id.street2:
<p style="margin:0px 0px 0px 0px;">${object.job_id.address_id.street2}</p>
% set location = '%s, %s' % (location, object.job_id.address_id.street2)
% endif
<p style="margin:0px 0px 0px 0px;">
% if object.job_id.address_id.city:
${object.job_id.address_id.city},
% set location = '%s, %s' % (location, object.job_id.address_id.city)
% endif
% if object.job_id.address_id.state_id.name:
${object.job_id.address_id.state_id.name},
% set location = '%s, %s' % (location, object.job_id.address_id.state_id.name)
% endif
% if object.job_id.address_id.zip:
${object.job_id.address_id.zip}
% set location = '%s, %s' % (location, object.job_id.address_id.zip)
% endif
</p>
% if object.job_id.address_id.country_id.name:
<p style="margin:0px 0px 0px 0px;">${object.job_id.address_id.country_id.name}</p>
% set location = '%s, %s' % (location, object.job_id.address_id.country_id.name)
% endif
</td>
</tr>
</table>
% if object.job_id.address_id:
<div style="width:598px;margin:0px auto;border-left:1px solid #dddddd;border-right:1px solid #dddddd;border-bottom:1px solid #dddddd;">
<a href="https://maps.google.com/maps?q=${location}" target="new">
<img src="http://maps.googleapis.com/maps/api/staticmap?autoscale=1&size=598x200&maptype=roadmap&format=png&visual_refresh=true&markers=size:mid%7Ccolor:0xa5117d%7Clabel:%7C${location}" style="vertical-align:bottom;" alt="Google Maps"/>
</a>
<field name="body_html" type="html">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="background-color: white; border-collapse: collapse; margin-left: 20px;">
<tr>
<td valign="top" style="padding: 0px 10px;">
<div style="text-align: center">
<h2>Congratulations!</h2>
<div style="color:grey;">Your resume has been positively reviewed.</div>
<img src="/hr_recruitment/static/src/img/congratulations.png" alt="Congratulations!" style="width:175px;margin:20px 0;"/>
</div>
% endif
<table style="width:600px;margin:0px auto;text-align:center;">
<tbody>
<tr>
<td style="padding-top:10px;font-size: 12px;">
<div>Sent by ${object.company_id.name}</div>
% if 'website_url' in object.job_id and object.job_id.website_url:
<div>
Discover <a href="/jobs" style="text-decoration:none;color:#717188;">all our jobs</a>.
</div>
% endif
</td>
</tr>
</tbody>
</table>
<div style="font-size: 13px; margin: 0px; padding: 0px;">
We just reviewed your resume, and it caught our
attention. As we think you might be great for the
position, your application has been short listed for a
call or an interview.
<br/><br/>
% if 'website_url' in object.job_id and object.job_id.website_url:
<div style="margin: 16px 8px 16px 8px;">
<a href="${object.job_id.website_url}"
style="background-color: #875a7b; text-decoration: none; color: #fff; padding: 8px 16px 8px 16px; border-radius: 5px;">Job Description</a>
</div>
% endif
% if object.user_id:
You will soon be contacted by:
<table>
<tr>
<td width="75">
<img src="/web/image/res.users/${object.user_id.id}/image_small" alt="Avatar" style="vertical-align:baseline;max-width:64px;" />
</td>
<td>
<strong>${object.user_id.name}</strong><br/>
<span>Email: ${object.user_id.email or ''}</span><br/>
<span>Phone: ${object.user_id.phone or ''}</span>
</td>
</tr>
</table>
<br/><br/>
% endif
See you soon,
<div style="font-size: 11px; color: grey;">
-- <br/>
Odoo HR Team
% if 'website_url' in object.job_id and object.job_id.website_url
Discover <a href="/jobs" style="text-decoration:none;color:#717188;">all our jobs</a>.<br/>
% endif
</div>
</div>
]]></field>
<hr width="97%" 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;"/>
<h3 style="color:#9A6C8E;"><strong>What is the next step?</strong></h3>
We usually <strong>answer applications within 3 days</strong>.
<br/><br/>
The next step is either a call or a meeting in our offices.
<br/>
Feel free to <strong>contact us if you want a faster
feedback</strong> or if you don't get news from us
quickly enough (just reply to this email).
<br/>
<hr width="97%" 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;"/>
<h3 style="color:#9A6C8E;"><strong>Want to learn about us?</strong></h3>
<ol>
<li><a style="color:#1CC5A9" href="https://www.odoo.com/blog/odoo-news-5/post/the-odoo-story-56">Founders' story</a></li>
<li><a style="color:#1CC5A9" href="https://www.slideshare.net/openobject/the-odoo-culture">The Odoo Culture</a></li>
<li><a style="color:#1CC5A9" href="https://www.odoo.com/page/about-us">About us</a></li>
</ol>
<hr width="97%" style="background-color: rgb(204,204,204); border: medium none; clear: both; display: block; font-size: 0px; min-height: 1px; line-height: 0; margin: 17px 0px 16px 0px;"/>
% set location = ''
% if object.job_id.address_id.name:
<strong>${object.job_id.address_id.name}</strong><br/>
% endif
% if object.job_id.address_id.street:
${object.job_id.address_id.street}<br/>
% set location = object.job_id.address_id.street
% endif
% if object.job_id.address_id.street2:
${object.job_id.address_id.street2}<br/>
% set location = '%s, %s' % (location, object.job_id.address_id.street2)
% endif
% if object.job_id.address_id.city:
${object.job_id.address_id.city},
% set location = '%s, %s' % (location, object.job_id.address_id.city)
% endif
% if object.job_id.address_id.state_id.name:
${object.job_id.address_id.state_id.name},
% set location = '%s, %s' % (location, object.job_id.address_id.state_id.name)
% endif
% if object.job_id.address_id.zip:
${object.job_id.address_id.zip}
% set location = '%s, %s' % (location, object.job_id.address_id.zip)
% endif
<br/>
% if object.job_id.address_id.country_id.name:
${object.job_id.address_id.country_id.name}<br/>
% set location = '%s, %s' % (location, object.job_id.address_id.country_id.name)
% endif
<br/>
% if object.job_id.address_id:
<a href="https://maps.google.com/maps?q=${location}" target="new">
<img src="http://maps.googleapis.com/maps/api/staticmap?autoscale=1&amp;size=598x200&amp;maptype=roadmap&amp;format=png&amp;visual_refresh=true&amp;markers=size:mid%7Ccolor:0xa5117d%7Clabel:%7C${location}" style="vertical-align:bottom;"/>
</a>
% endif
</div>
</td>
</tr>
</table></field>
<field name="user_signature" eval="False"/>
<field name="auto_delete" eval="True"/>
<field name="lang">${object.partner_id.lang or ''}</field>
</record>
<record id="email_template_data_applicant_congratulations" model="mail.template">
<field name="name">Applicant: Acknowledgment</field>
<field name="subject">Job Application Confirmation: ${object.job_id.name | safe}</field>
<field name="model_id" ref="hr_recruitment.model_hr_applicant"/>
<field name="subject">Your Job Application: ${object.job_id.name | safe}</field>
<field name="email_to">${(not object.partner_id and object.email_from or '') | safe}</field>
<field name="partner_to">${object.partner_id.id or ''}</field>
<field name="lang">${object.partner_id.lang or ''}</field>
<field name="model_id" ref="hr_recruitment.model_hr_applicant"/>
<field name="user_signature" eval="False"/>
<field name="body_html"><![CDATA[
<div style="background-color:#F3F5F6;color:#515166;font-family:Arial,Helvetica,sans-serif;font-size:14px;">
<table style="width:600px;margin:10px auto;">
<tbody>
<tr>
<td>
<a href="/">
<img src="/logo" alt="${object.company_id.name}" style="vertical-align:baseline;max-width:100px;" />
</a>
</td>
<td style="text-align:right;vertical-align:middle;">
% if 'website_url' in object.job_id and object.job_id.website_url:
<a href="${object.job_id.website_url}" style="background-color: #1abc9c; padding: 12px; font-weight: 12px; text-decoration: none; color: #fff; border-radius: 5px; font-size:16px;">Job Description</a>
% endif
</td>
</tr>
</tbody>
</table>
<table style="width:600px;margin:0px auto;background-color:white;padding:8px;border:1px solid #e1e1e1;">
<tr>
<td style="font-size:16px; font-weight:300;">
<p style="font-size:16px;">
Hi,
</p><p style="font-size:16px;">
We confirm we successfully received your application to the job
<field name="body_html" type="html">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="background-color: white; border-collapse: collapse; margin-left: 20px;">
<tr>
<td valign="top" style="padding: 0px 10px;">
<div style="font-size: 13px; margin: 0px; padding: 0px;">
Hello,
<br/><br/>
We confirm we successfully received your application to the job
"<a href="${object.job_id.website_url or ''}" style="color:#9A6C8E;"><strong>${object.job_id.name}</strong></a>" at <strong>${object.company_id.name}</strong>.
<br/><br/>
We will come back to you shortly.
"<a href="${object.job_id.website_url or ''}" style="color:#9A6C8E;"><strong>${object.job_id.name}</strong></a>"
at <strong>${object.company_id.name}</strong>.
</p>
<p style="font-size:16px;">
We will come back to you shortly.
</p>
% if 'website_url' in object.job_id and object.job_id.website_url:
<div style="margin: 16px 8px 16px 8px;">
<a href="${object.job_id.website_url}"
style="background-color: #875a7b; text-decoration: none; color: #fff; padding: 8px 16px 8px 16px; border-radius: 5px;">Job Description</a>
</div>
% endif
<hr style="margin: 30px 0"/>
% if object.user_id:
<hr width="97%" 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;"/>
% if object.user_id:
<h3 style="color:#9A6C8E;"><strong>Your Contact:</strong></h3>
<table style="width:100%; border:0px solid white;">
<tr>
<td width="75">
<img src="/web/image/res.users/${object.user_id.id}/image_small" alt="Avatar" style="vertical-align:baseline;max-width:64px;" />
</td><td style="font-size:15px;">
<strong>${object.user_id.name}</strong><br/>
<span>Email: ${object.user_id.email or ''}</span><br/>
<span>Phone: ${object.user_id.phone or ''}</span>
</td>
</tr>
<table>
<tr>
<td width="75">
<img src="/web/image/res.users/${object.user_id.id}/image_small" alt="Avatar" style="vertical-align:baseline;max-width:64px;" />
</td>
<td>
<strong>${object.user_id.name}</strong><br/>
<span>Email: ${object.user_id.email or ''}</span><br/>
<span>Phone: ${object.user_id.phone or ''}</span>
</td>
</tr>
</table>
% endif
<hr width="97%" 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;"/>
% endif
<hr style="margin: 30px 0"/>
<h3 style="color:#9A6C8E;"><strong>What is the next step?</strong></h3>
We usually <strong>answer applications within 3 days.</strong><br/><br/>
Feel free to <strong>contact us if you want a faster
feedback</strong> or if you don't get news from us
quickly enough (just reply to this email).
<h3 style="color:#9A6C8E;"><strong>What is the next step?</strong></h3>
<p>We usually <strong>answer applications within 3 days.</strong></p>
<p>
Feel free to <strong>contact us if you want a faster
feedback</strong> or if you don't get news from us
quickly enough (just reply to this email).
</p>
<hr style="margin: 30px 0"/>
<hr width="97%" 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;"/>
<h3 style="color:#9A6C8E;"><strong>Want to learn more?</strong></h3>
<ol>
<li><a style="color:#1CC5A9" href="https://www.odoo.com/blog/odoo-news-5/post/the-odoo-story-56">Founders' story</a></li>
<li><a style="color:#1CC5A9" href="https://www.slideshare.net/openobject/the-odoo-culture">The Odoo Culture</a></li>
<li><a style="color:#1CC5A9" href="https://www.odoo.com/page/about-us">About us</a></li>
</ol>
<h3 style="color:#9A6C8E;"><strong>Want to learn more?</strong></h3>
<ol>
<li><a style="color:#1CC5A9" href="https://www.odoo.com/blog/odoo-news-5/post/the-odoo-story-56">Founders' story</a></li>
<li><a style="color:#1CC5A9" href="https://www.slideshare.net/openobject/the-odoo-culture">The Odoo Culture</a></li>
<li><a style="color:#1CC5A9" href="https://www.odoo.com/page/about-us">About us</a></li>
</ol>
<hr style="margin: 30px 0"/>
% set location = ''
% if object.job_id.address_id.name:
<p style="margin:0px 0px 0px 0px;"><strong>${object.job_id.address_id.name}</strong></p>
% endif
% if object.job_id.address_id.street:
<p style="margin:0px 0px 0px 0px;">${object.job_id.address_id.street}</p>
% set location = object.job_id.address_id.street
% endif
% if object.job_id.address_id.street2:
<p style="margin:0px 0px 0px 0px;">${object.job_id.address_id.street2}</p>
% set location = '%s, %s' % (location, object.job_id.address_id.street2)
% endif
<p style="margin:0px 0px 0px 0px;">
% if object.job_id.address_id.city:
${object.job_id.address_id.city},
% set location = '%s, %s' % (location, object.job_id.address_id.city)
% endif
% if object.job_id.address_id.state_id.name:
${object.job_id.address_id.state_id.name},
% set location = '%s, %s' % (location, object.job_id.address_id.state_id.name)
% endif
% if object.job_id.address_id.zip:
${object.job_id.address_id.zip}
% set location = '%s, %s' % (location, object.job_id.address_id.zip)
% endif
</p>
% if object.job_id.address_id.country_id.name:
<p style="margin:0px 0px 0px 0px;">${object.job_id.address_id.country_id.name}</p>
% set location = '%s, %s' % (location, object.job_id.address_id.country_id.name)
% endif
</td>
</tr>
</table>
% if object.job_id.address_id:
<div style="width:598px;margin:0px auto;border-left:1px solid #dddddd;border-right:1px solid #dddddd;border-bottom:1px solid #dddddd;">
<a href="https://maps.google.com/maps?q=${location}" target="new">
<img src="http://maps.googleapis.com/maps/api/staticmap?autoscale=1&size=598x200&maptype=roadmap&format=png&visual_refresh=true&markers=size:mid%7Ccolor:0xa5117d%7Clabel:%7C${location}" style="vertical-align:bottom;" alt="Google Maps"/>
</a>
<hr width="97%" style="background-color: rgb(204,204,204); border: medium none; clear: both; display: block; font-size: 0px; min-height: 1px; line-height: 0; margin: 17px 0px 16px 0px;"/>
% set location = ''
% if object.job_id.address_id.name:
<strong>${object.job_id.address_id.name}</strong><br/>
% endif
% if object.job_id.address_id.street:
${object.job_id.address_id.street}<br/>
% set location = object.job_id.address_id.street
% endif
% if object.job_id.address_id.street2:
${object.job_id.address_id.street2}<br/>
% set location = '%s, %s' % (location, object.job_id.address_id.street2)
% endif
% if object.job_id.address_id.city:
${object.job_id.address_id.city},
% set location = '%s, %s' % (location, object.job_id.address_id.city)
% endif
% if object.job_id.address_id.state_id.name:
${object.job_id.address_id.state_id.name},
% set location = '%s, %s' % (location, object.job_id.address_id.state_id.name)
% endif
% if object.job_id.address_id.zip:
${object.job_id.address_id.zip}
% set location = '%s, %s' % (location, object.job_id.address_id.zip)
% endif
<br/>
% if object.job_id.address_id.country_id.name:
${object.job_id.address_id.country_id.name}<br/>
% set location = '%s, %s' % (location, object.job_id.address_id.country_id.name)
% endif
<br/>
% if object.job_id.address_id:
<a href="https://maps.google.com/maps?q=${location}" target="new">
<img src="http://maps.googleapis.com/maps/api/staticmap?autoscale=1&amp;size=598x200&amp;maptype=roadmap&amp;format=png&amp;visual_refresh=true&amp;markers=size:mid%7Ccolor:0xa5117d%7Clabel:%7C${location}" style="vertical-align:bottom;"/>
</a>
% endif
</div>
% endif
<table style="width:600px;margin:0px auto;text-align:center;">
<tbody>
<tr>
<td style="padding-top:10px;font-size: 12px;">
<div>Sent by ${object.company_id.name}</div>
% if 'website_url' in object.job_id and object.job_id.website_url:
<div>
Discover <a href="/jobs" style="text-decoration:none;color:#717188;">all our jobs</a>.
</div>
% endif
</td>
</tr>
</tbody>
</table>
</div>
]]></field>
</td>
</tr>
</table></field>
<field name="user_signature" eval="False"/>
<field name="auto_delete" eval="True"/>
<field name="lang">${object.partner_id.lang or ''}</field>
</record>
<record id="email_template_data_applicant_employee" model="mail.template">
<field name="name">Applicant: Welcome new employee</field>
<field name="subject">Welcome ${object.name} </field>
<field name="model_id" ref="hr.model_hr_employee"/>
<field name="body_html"><![CDATA[
<p>Dear all,</p>
<p>I’m very pleased to announce that <strong> ${object.name} </strong> will be
joining us as a ${object.job_id.name}
%if object.department_id:
in ${object.department_id.name}.
%endif
.</p>
<p>Please welcome him/her and help him/her finding his/her marks.</p>]]></field>
</record>
<!-- Resource(type_id) -->
<record model="hr.recruitment.degree" id="degree_graduate">
<field name="name">Graduate</field>
<field name="sequence">1</field>
@@ -21,19 +21,3 @@ class HrEmployee(models.Model):
def _search_newly_hired_employee(self, operator, value):
applicants = self.env['hr.applicant'].search([('job_id.state', '=', 'recruit')])
return [('id', 'in', applicants.ids)]
@api.multi
def _broadcast_welcome(self):
""" Broadcast the welcome message to all users in the employee company. """
self.ensure_one()
IrModelData = self.env['ir.model.data']
channel_all_employees = IrModelData.xmlid_to_object('mail.channel_all_employees')
template_new_employee = IrModelData.xmlid_to_object('hr_recruitment.email_template_data_applicant_employee')
if template_new_employee:
MailTemplate = self.env['mail.template']
body_html = MailTemplate.render_template(template_new_employee.body_html, 'hr.employee', self.id)
subject = MailTemplate.render_template(template_new_employee.subject, 'hr.employee', self.id)
channel_all_employees.message_post(
body=body_html, subject=subject,
subtype='mail.mt_comment')
return True
@@ -338,7 +338,11 @@ class Applicant(models.Model):
applicant = self[0]
changes, dummy = tracking[applicant.id]
if 'stage_id' in changes and applicant.stage_id.template_id:
res['stage_id'] = (applicant.stage_id.template_id, {'composition_mode': 'mass_mail'})
res['stage_id'] = (applicant.stage_id.template_id, {
'auto_delete_message': True,
'subtype_id': self.env['ir.model.data'].xmlid_to_res_id('mail.mt_note'),
'notif_layout': 'mail.mail_notification_light'
})
return res
@api.multi
@@ -445,7 +449,6 @@ class Applicant(models.Model):
applicant.job_id.message_post(
body=_('New Employee %s Hired') % applicant.partner_name if applicant.partner_name else applicant.name,
subtype="hr_recruitment.mt_job_applicant_hired")
employee._broadcast_welcome()
else:
raise UserError(_('You must define an Applied Job and a Contact Name for this applicant.'))
@@ -2,47 +2,37 @@
<odoo>
<data noupdate="1">
<record id="account.email_template_edi_invoice" model="mail.template">
<field name="body_html"><![CDATA[
<p>Dear ${object.partner_id.name}
% set access_action = object.with_context(force_website=True).get_access_action()
% set is_online = access_action and access_action['type'] == 'ir.actions.act_url'
% set access_url = is_online and object.get_mail_url() or '/report/pdf/account.report_invoice/' + str(object.id)
% if object.partner_id.parent_id:
(<i>${object.partner_id.parent_id.name}</i>)
% endif
,</p>
<p>Here is your
% if object.number:
invoice <strong>${object.number}</strong>
% else:
pro-forma invoice
% endif
% if object.origin:
(with reference: ${object.origin} )
% endif
amounting in <strong>${format_amount(object.amount_total, object.currency_id)}</strong>
from ${object.company_id.name}.
</p>
% if is_online:
<br/><br/>
<center>
<a href="${access_url}" style="background-color: #1abc9c; padding: 20px; text-decoration: none; color: #fff; border-radius: 5px; font-size: 16px;" class="o_default_snippet_text">View Invoice</a>
</center>
% endif
<br/><br/>
% if object.reference_type=='bba' and object.reference:
<p>Please use the following communication for your payment : <b>${object.reference}</b></p>
% endif
<p>Please remit payment at your earliest convenience.</p>
<p>Thank you,</p>
% if object.user_id and object.user_id.signature:
${object.user_id.signature | safe}
% endif
]]></field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
Dear ${object.partner_id.name}
% if object.partner_id.parent_id:
(${object.partner_id.parent_id.name})
% endif
<br /><br />
Here is, in attachment, your
% if object.number:
invoice <strong>${object.number}</strong>
% else:
invoice
%endif
% if object.origin:
(with reference: ${object.origin} )
% endif
amounting in <strong>${format_amount(object.amount_total, object.currency_id)}</strong>
from ${object.company_id.name}.
% if object.state=='paid':
This invoice is already paid.
% else:
Please remit payment at your earliest convenience.
% if object.reference_type == 'bba' and object.reference:
Please use the following communication for your payment: <strong>${object.reference}</strong>.
% endif
<br /><br />
Do not hesitate to contact us if you have any question.
</p>
</div>
</field>
</record>
</data>
</odoo>
+4 -4
View File
@@ -168,7 +168,7 @@
<tr><td valign="middle">
<span style="font-size: 10px;">Your <t t-esc="'%s' % model_description or 'document'"/></span><br/>
<span style="font-size: 20px; font-weight: bold;">
<t t-esc="message.record_name"/>
<t t-esc="message.record_name and message.record_name.replace('/','-') or ''"/>
</span>
</td><td valign="middle" align="right">
<img t-att-src="'/logo.png?company=%s' % company.id" style="padding: 0px; margin: 0px; height: auto; width: 80px;" t-att-alt="'%s' % company.name"/>
@@ -183,7 +183,7 @@
<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="top" style="font-size: 14px;">
<tr><td valign="top" style="font-size: 13px;">
<t t-raw="message.body"/>
</td></tr>
<tr><td style="text-align:center;">
@@ -195,7 +195,7 @@
<!-- FOOTER -->
<tr>
<td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; font-size: 12px; padding: 0px 8px 0px 8px; border-collapse:separate;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;">
<tr><td valign="middle" align="left">
<t t-esc="company.name"/>
</td></tr>
@@ -219,7 +219,7 @@
<!-- POWERED BY -->
<tr><td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;">
<tr><td style="text-align: center; font-size: 14px;">
<tr><td style="text-align: center; font-size: 13px;">
Powered by <a target="_blank" href="https://www.odoo.com" style="color: #875A7B;">Odoo</a>
</td></tr>
</table>
+26 -13
View File
@@ -405,7 +405,6 @@ class MailTemplate(models.Model):
"""Generates an email from the template for given the given model based on
records given by res_ids.
:param template_id: id of the template to render.
:param res_id: id of the record to use for rendering the template (model
is taken from template definition)
:returns: a dict containing all relevant fields for creating a new
@@ -487,19 +486,18 @@ class MailTemplate(models.Model):
return multi_mode and results or results[res_ids[0]]
@api.multi
def send_mail(self, res_id, force_send=False, raise_exception=False, email_values=None):
"""Generates a new mail message for the given template and record,
and schedules it for delivery through the ``mail`` module's scheduler.
def send_mail(self, res_id, force_send=False, raise_exception=False, email_values=None, notif_layout=False):
""" Generates a new mail.mail. Template is rendered on record given by
res_id and model coming from template.
:param int res_id: id of the record to render the template with
(model is taken from the template)
:param bool force_send: if True, the generated mail.message is
immediately sent after being created, as if the scheduler
was executed for this message only.
:param dict email_values: if set, the generated mail.message is
updated with given values dict
:returns: id of the mail.message that was created
"""
:param int res_id: id of the record to render the template
:param bool force_send: send email immediately; otherwise use the mail
queue (recommended);
:param dict email_values: update generated mail with those values to further
customize the mail;
:param str notif_layout: optional notification layout to encapsulate the
generated email;
:returns: id of the mail.mail that was created """
self.ensure_one()
Mail = self.env['mail.mail']
Attachment = self.env['ir.attachment'] # TDE FIXME: should remove dfeault_type from context
@@ -513,6 +511,21 @@ class MailTemplate(models.Model):
# add a protection against void email_from
if 'email_from' in values and not values.get('email_from'):
values.pop('email_from')
# encapsulate body
if notif_layout and values['body_html']:
try:
template = self.env.ref(notif_layout, raise_if_not_found=True)
except ValueError:
_logger.warning('QWeb template %s not found when sending template %s. Sending without layouting.' % (notif_layout, self.name))
else:
record = self.env[self.model].browse(res_id)
template_ctx = {
'message': self.env['mail.message'].sudo().new(dict(body=values['body_html'], record_name=record.display_name)),
'model_description': self.env['ir.model']._get(record._name).display_name,
'company': 'company_id' in record and record['company_id'] or self.env.user.company_id,
}
body = template.render(template_ctx, engine='ir.qweb', minimal_qcontext=True)
values['body_html'] = self.env['mail.thread']._replace_local_links(body)
mail = Mail.create(values)
# manage attachments
@@ -94,20 +94,5 @@
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<!-- Replace the default mass-mailing wizard in base with the composition wizard -->
<act_window name="Send Email"
res_model="mail.compose.message"
src_model="res.partner"
view_mode="form"
multi="True"
target="new"
key2="client_action_multi"
id="action_partner_mass_mail"
context="{
'default_composition_mode': 'mass_mail',
'default_partner_to': '${object.id or \'\'}',
'default_active_domain': [['id', 'in', context.get('active_ids', [])]],
}"/>
</data>
</odoo>
+86 -26
View File
@@ -5,34 +5,94 @@
<record id="mail_template_data_portal_welcome" model="mail.template">
<field name="name">Portal: new user</field>
<field name="model_id" ref="portal.model_portal_wizard_user"/>
<field name="email_to">${object.partner_id.email}</field>
<field name="subject">Your Odoo account at ${user.company_id.name}</field>
<field name="subject">Your Odoo account at ${object.user_id.company_id.name}</field>
<field name="email_to">${object.user_id.email_formatted | safe}</field>
<field name="body_html" type="html">
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">
<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">
<span style="font-size: 10px;">Your Account</span><br/>
<span style="font-size: 20px; font-weight: bold;">
${object.user_id.name}
</span>
</td><td valign="middle" align="right">
<img src="/logo.png?company=${object.user_id.company_id.id}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${object.user_id.company_id.name}"/>
</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;">
<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="top" style="font-size: 13px;">
<div>
Dear ${object.user_id.name or ''},<br/> <br/>
You have been given access to ${object.user_id.company_id.name}'s portal.<br/>
Your login account data is:
<ul>
<li>Username: ${object.user_id.login or ''}</li>
<li>Portal: <a href="${'portal_url' in ctx and ctx['portal_url'] or ''}">${'portal_url' in ctx and ctx['portal_url'] or ''}</a></li>
<li>Database: ${'dbname' in ctx and ctx['dbname'] or ''}</li>
</ul>
You can set or change your password via the following url:
<ul>
<li><a href="${object.user_id.signup_url}">${object.user_id.signup_url}</a></li>
</ul>
${object.wizard_id.welcome_message or ''}
</div>
</td></tr>
<tr><td 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>
<!-- FOOTER -->
<tr>
<td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;">
<tr><td valign="middle" align="left">
${object.user_id.company_id.name}
</td></tr>
<tr><td valign="middle" align="left" style="opacity: 0.7;">
${object.user_id.company_id.phone}
% if object.user_id.company_id.email
| <a href="'mailto:%s' % ${object.user_id.company_id.email}" style="text-decoration:none; color: #454748;">${object.user_id.company_id.email}</a>
% endif
% if object.user_id.company_id.website
| <a href="'%s' % ${object.user_id.company_id.website}" style="text-decoration:none; color: #454748;">
${object.user_id.company_id.website}
</a>
% endif
</td></tr>
</table>
</td>
</tr>
</tbody>
</table>
</td></tr>
<!-- POWERED BY -->
<tr><td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;">
<tr><td style="text-align: center; font-size: 13px;">
Powered by <a target="_blank" href="https://www.odoo.com" style="color: #875A7B;">Odoo</a>
</td></tr>
</table>
</td></tr>
</table>
</field>
<field name="lang">${object.partner_id.lang}</field>
<field name="auto_delete" eval="True"/>
<field name="user_signature" eval="True"/>
<field name="body_html"><![CDATA[
<p>
Dear ${object.user_id.name or ''},
</p>
<p>
You have been given access to ${user.company_id.name}'s portal.
</p>
<p>
Your login account data is:
</p>
<ul>
<li>Username: ${object.user_id.login or ''}</li>
<li>Portal: <a href="${'portal_url' in ctx and ctx['portal_url'] or ''}">${'portal_url' in ctx and ctx['portal_url'] or ''}</a></li>
<li>Database: ${'dbname' in ctx and ctx['dbname'] or ''}</li>
</ul>
<p>
You can set or change your password via the following url:
</p>
<ul>
<li><a href="${object.user_id.signup_url}">${object.user_id.signup_url}</a></li>
</ul>
<p>
${object.wizard_id.welcome_message or ''}]]></field>
<field name="user_signature" eval="False"/>
</record>
</data>
</odoo>
+1 -1
View File
@@ -143,7 +143,7 @@ class PortalWizardUser(models.TransientModel):
wizard_user.user_id.write({'active': True, 'groups_id': [(4, group_portal.id)]})
# prepare for the signup process
wizard_user.user_id.partner_id.signup_prepare()
wizard_user.with_context(active_test=True)._send_email()
wizard_user.with_context(active_test=True)._send_email()
wizard_user.refresh()
else:
# remove the user (if it exists) from the portal group
+4 -2
View File
@@ -4,8 +4,8 @@
<record id="email_template_edi_purchase" model="mail.template">
<field name="name">Purchase Order: Send RFQ</field>
<field name="model_id" ref="purchase.model_purchase_order"/>
<field name="email_from">${object.create_uid.email_formatted | safe}</field>
<field name="subject">${object.company_id.name} Order (Ref ${object.name or 'n/a' })</field>
<field name="email_from">${object.create_uid.email_formatted | safe}</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
@@ -40,8 +40,8 @@
<record id="email_template_edi_purchase_done" model="mail.template">
<field name="name">Purchase Order: Send PO</field>
<field name="model_id" ref="purchase.model_purchase_order"/>
<field name="email_from">${object.create_uid.email_formatted | safe}</field>
<field name="subject">${object.company_id.name} Order (Ref ${object.name or 'n/a' })</field>
<field name="email_from">${object.create_uid.email_formatted | safe}</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
@@ -62,6 +62,8 @@
from ${object.company_id.name}.
<br /><br />
Do not hesitate to contact us if you have any question.
<br /><br />
Best regards,
</p>
</div></field>
<field name="report_template" ref="action_report_purchase_order"/>
+24 -20
View File
@@ -1,31 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!--Email template -->
<record id="mail_template_repair_quotation" model="mail.template">
<field name="name">Repair Quotation - Send by Email</field>
<field name="email_from">${(object.create_uid.email and '%s &lt;%s&gt;' % (object.create_uid.name, object.create_uid.email) or '')|safe}</field>
<field name="subject">${object.partner_id.name} Repair Orders (Ref ${object.name or 'n/a' })</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="name">Repair Quotation: Send by email</field>
<field name="model_id" ref="repair.model_repair_order"/>
<field name="subject">${object.partner_id.name} Repair Orders (Ref ${object.name or 'n/a' })</field>
<field name="email_from">${(object.create_uid.email and '%s &lt;%s&gt;' % (object.create_uid.name, object.create_uid.email) or '')|safe}</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="body_html" type="xml">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px;font-size: 13px;">
Hello ${object.partner_id.name},<br/>
Here is your repair order ${doc_name} <strong>${object.name}</strong>
% if object.origin:
(with reference: ${object.origin} )
% endif
% if object.invoice_method != 'none':
amounting in <strong>${format_amount(object.amount_total, object.pricelist_id.currency_id)}.</strong><br/>
% else:
.<br/>
% endif
You can reply to this email if you have any questions.
<br/><br/>
Thank you,
</p>
</div></field>
<field name="report_template" ref="action_report_repair_order"/>
<field name="report_name">${(object.name or '').replace('/','_')}</field>
<field name="lang">${object.partner_id.lang}</field>
<field name="body_html" type="xml">
<p>Dear ${object.partner_id.name}</p>
<p>
Here is your repair order ${doc_name} <strong>${object.name}</strong>
% if object.origin:
(with reference: ${object.origin} )
% endif
% if object.invoice_method != 'none':
amounting in <strong>${format_amount(object.amount_total, object.pricelist_id.currency_id)}.</strong>
% endif
</p>
<p>You can reply to this email if you have any questions.</p>
<p>Thank you,</p>
</field>
<field name="auto_delete" eval="True"/>
<field name="user_signature" eval="True"/>
</record>
</data>
</odoo>
+2 -1
View File
@@ -256,7 +256,8 @@ class Repair(models.Model):
'default_res_id': self.id,
'default_use_template': bool(template_id),
'default_template_id': template_id,
'default_composition_mode': 'comment'
'default_composition_mode': 'comment',
'custom_layout': 'mail.mail_notification_light',
}
return {
'type': 'ir.actions.act_window',
+1
View File
@@ -25,6 +25,7 @@ sent mails with personal token for the invitation of the survey.
'views/survey_templates.xml',
'views/survey_result.xml',
'views/res_users_views.xml',
'data/mail_template_data.xml',
'wizard/survey_email_compose_message.xml',
'data/survey_stages.xml',
],
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="email_template_survey" model="mail.template">
<field name="name">Survey: Send by email</field>
<field name="model_id" ref="model_survey_survey" />
<field name="subject">${object.title}: Survey</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px; font-size: 13px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
Hello<br /><br />
We are conducting a survey, and your response would be appreciated.
<div style="margin: 16px 0px 16px 0px;">
<a href="__URL__"
style="background-color: #875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;">
Start Survey
</a>
</div>
Thanks for your participation!
</p>
</div>
</field>
<field name="auto_delete" eval="True"/>
<field name="user_signature" eval="False"/>
</record>
</data>
</odoo>
+2 -1
View File
@@ -326,7 +326,8 @@ class Survey(models.Model):
default_survey_id=self.id,
default_use_template=bool(template),
default_template_id=template and template.id or False,
default_composition_mode='comment'
default_composition_mode='comment',
notif_layout='mail.mail_notification_light',
)
return {
'type': 'ir.actions.act_window',
+3 -1
View File
@@ -124,7 +124,9 @@ class TestSurvey(TransactionCase):
default_survey_id=correct_survey.id,
default_use_template=bool(template),
default_template_id=template and template.id or False,
default_composition_mode='comment')
default_composition_mode='comment',
notif_layout='mail.mail_notification_light',
)
self.assertDictEqual(action, {
'type': 'ir.actions.act_window',
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import re
import uuid
@@ -10,9 +11,12 @@ from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.tools import pycompat
_logger = logging.getLogger(__name__)
emails_split = re.compile(r"[;,\n\r]+")
email_validator = re.compile(r"[^@]+@[^@]+\.[^@]+")
class SurveyMailComposeMessage(models.TransientModel):
_name = 'survey.mail.compose.message'
_inherit = 'mail.compose.message'
@@ -73,6 +77,11 @@ class SurveyMailComposeMessage(models.TransientModel):
#------------------------------------------------------
# Wizard validation and send
#------------------------------------------------------
@api.multi
def send_mail_action(self):
return self.send_mail()
@api.multi
def send_mail(self, auto_commit=False):
""" Process the wizard content and proceed with sending the related
@@ -81,6 +90,7 @@ class SurveyMailComposeMessage(models.TransientModel):
SurveyUserInput = self.env['survey.user_input']
Partner = self.env['res.partner']
Mail = self.env['mail.mail']
notif_layout = self.env.context.get('notif_layout', self.env.context.get('custom_layout'))
def create_response_and_send_mail(wizard, token, partner_id, email):
""" Create one mail by recipients and replace __URL__ by link with identification token """
@@ -106,6 +116,22 @@ class SurveyMailComposeMessage(models.TransientModel):
values['recipient_ids'] = [(4, partner_id)]
else:
values['email_to'] = email
# optional support of notif_layout in context
if notif_layout:
try:
template = self.env.ref(notif_layout, raise_if_not_found=True)
except ValueError:
_logger.warning('QWeb template %s not found when sending survey mails. Sending without layouting.' % (notif_layout))
else:
template_ctx = {
'message': self.env['mail.message'].sudo().new(dict(body=values['body_html'], record_name=wizard.survey_id.title)),
'model_description': self.env['ir.model']._get('survey.survey').display_name,
'company': self.env.user.company_id,
}
body = template.render(template_ctx, engine='ir.qweb', minimal_qcontext=True)
values['body_html'] = self.env['mail.thread']._replace_local_links(body)
Mail.create(values).send()
def create_token(wizard, partner_id, email):
@@ -1,20 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!--Survey send invitation by email: template -->
<record id="email_template_survey" model="mail.template">
<field name="name">Survey - Send by Email</field>
<field name="model_id" ref="model_survey_survey" />
<field name="auto_delete" eval="True" />
<field name="body_html">
<![CDATA[
<p>Hello,</p>
<p>We are conducting a survey, and your response would be appreciated.</p>
<p><a style="margin-left: 85px; padding:5px 10px; border-radius: 3px; background-color:#875A7B; text-align:center; text-decoration:none; color:#F7FBFD;" href="__URL__">Please, click here to start survey</a></p>
<p>Thanks for your participation!</p>
]]>
</field>
</record>
<!-- Replace the default mass-mailing wizard in base with the composition wizard -->
@@ -69,7 +55,7 @@
<button string="Close" class="btn-primary" special="cancel" />
</footer>
<footer attrs="{'invisible':['|',('public','=',False),('public','in',['public_link'])]}">
<button string="Send" name="send_mail" type="object" class="btn-primary" />
<button string="Send" name="send_mail_action" type="object" class="btn-primary" />
<button string="Cancel" class="btn-default" special="cancel" />
<group class="oe_right" col="1">
<div>
@@ -14,42 +14,109 @@
<field name="color">4</field>
</record>
<record id="email_template_lead_forward_mail" model="mail.template">
<field name="name">Lead Mass Mail</field>
<field name="name">Lead Forward: Send to partner</field>
<field name="model_id" model="ir.model" search="[('name', '=', 'crm.lead.forward.to.partner')]"></field>
<field name="auto_delete" eval="True"/>
<field name="email_to">${ctx['partner_id'].email|safe}</field>
<field name="email_from">${(user.email or '')|safe}</field>
<field name="subject">Fwd: Lead: ${ctx['partner_id'].name}</field>
<field name="body_html"><![CDATA[
<p>Hello,</p>
<p>We have been contacted by those prospects that are in your region. Thus, the following leads have been assigned to ${ctx['partner_id'].name}:</p>
<ol>
% for lead in ctx['partner_leads']:
<li><a href="${lead.lead_link}">${lead.lead_id.name or 'Subject Undefined'}</a>, ${lead.lead_id.partner_name or lead.lead_id.contact_name or 'Contact Name Undefined'}, ${lead.lead_id.country_id and lead.lead_id.country_id.name or 'Country Undefined' }, ${lead.lead_id.email_from or 'Email Undefined'}, ${lead.lead_id.phone or ''} </li><br/>
% endfor
</ol>
% if ctx.get('partner_in_portal'):
<p>Please connect to your <a href="${object.get_portal_url()}">Partner Portal</a> to get details. On each lead are two buttons on the top left corner that you should press after having contacted the lead: "I'm interested" & "I'm not interested".</p>
% else:
<p>
You do not have yet a portal access to our database. Please contact
${ctx['partner_id'].user_id and ctx['partner_id'].user_id.email and 'your account manager %s (%s)' % (ctx['partner_id'].user_id.name,ctx['partner_id'].user_id.email) or 'us'}.
</p>
% endif
<p>The lead will be sent to another partner if you do not contact the lead before 20 days.</p>
<p>Thanks,</p>
${ctx['partner_id'].user_id and ctx['partner_id'].user_id.signature | safe or ''}
% if not ctx['partner_id'].user_id:
PS: It looks like you do not have an account manager assigned to you, please contact us.
% endif
]]></field>
<field name="email_from">${(user.email or '')|safe}</field>
<field name="email_to">${ctx['partner_id'].email|safe}</field>
<field name="body_html" type="html">
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">
<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">
<span style="font-size: 10px;">Your leads</span><br/>
</td><td valign="middle" align="right">
<img src="/logo.png?company=${user.company_id.id}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" t-att-alt="'%s' % company.name"/>
</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;">
<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="top" style="font-size: 13px;">
<div>
Hello,<br/>
We have been contacted by those prospects that are in your region. Thus, the following leads have been assigned to ${ctx['partner_id'].name}:<br/>
<ol>
% for lead in ctx['partner_leads']:
<li><a href="${lead.lead_link}">${lead.lead_id.name or 'Subject Undefined'}</a>, ${lead.lead_id.partner_name or lead.lead_id.contact_name or 'Contact Name Undefined'}, ${lead.lead_id.country_id and lead.lead_id.country_id.name or 'Country Undefined' }, ${lead.lead_id.email_from or 'Email Undefined'}, ${lead.lead_id.phone or ''} </li><br/>
% endfor
</ol>
% if ctx.get('partner_in_portal'):
Please connect to your <a href="${object.get_portal_url()}">Partner Portal</a> to get details. On each lead are two buttons on the top left corner that you should press after having contacted the lead: "I'm interested" &amp; "I'm not interested".<br/>
% else:
You do not have yet a portal access to our database. Please contact
${ctx['partner_id'].user_id and ctx['partner_id'].user_id.email and 'your account manager %s (%s)' % (ctx['partner_id'].user_id.name,ctx['partner_id'].user_id.email) or 'us'}.<br/>
% endif
The lead will be sent to another partner if you do not contact the lead before 20 days.<br/><br/>
Thank you,<br/>
${ctx['partner_id'].user_id and ctx['partner_id'].user_id.signature | safe or ''}
<br/>
% if not ctx['partner_id'].user_id:
PS: It looks like you do not have an account manager assigned to you, please contact us.
% endif
</div>
</td>
</tr>
<tr>
<td 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>
<!-- FOOTER -->
<tr>
<td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;">
<tr><td valign="middle" align="left">
${user.company_id.name}
</td></tr>
<tr><td valign="middle" align="left" style="opacity: 0.7;">
${user.company_id.phone}
% if user.company_id.phone and (user.company_id.email or user.company_id.website)
|
% endif
% if user.company_id.email
<a href="'mailto:%s' % ${user.company_id.email}" style="text-decoration:none; color: #454748;">${user.company_id.email}</a>
% endif
% if user.company_id.email and user.company_id.website
|
% endif
% if user.company_id.website
<a href="'%s' % ${user.company_id.website}" style="text-decoration:none; color: #454748;">
${user.company_id.website}
</a>
% endif
</td></tr>
</table>
</td>
</tr>
</tbody>
</table>
</td></tr>
<!-- POWERED BY -->
<tr><td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;">
<tr><td style="text-align: center; font-size: 13px;">
Powered by <a target="_blank" href="https://www.odoo.com" style="color: #875A7B;">Odoo</a>
</td></tr>
</table>
</td></tr>
</table>
</field>
<field name="auto_delete" eval="True"/>
</record>
</data>
+94 -38
View File
@@ -138,46 +138,102 @@
<record id="validation_email" model="mail.template">
<field name="name">Forum: Email Verification</field>
<field name="model_id" ref="base.model_res_users"/>
<field name="email_from"><![CDATA["${object.company_id.name|safe}" <${(object.company_id.email or user.email)|safe}>]]></field>
<field name="subject">${object.company_id.name} Forums validation</field>
<field name="email_from">${('&lt;%s&gt;' % (object.env.user.company_id.email or user.email)) | safe}</field>
<field name="email_to">${object.email|safe}</field>
<field name="subject"><![CDATA[${object.company_id.name} Forums validation]]></field>
<field name="body_html"><![CDATA[
<div summary="o_mail_notification" style="padding:0px; width:600px; margin:0 auto; background: #FFFFFF repeat top /100%;color:#777777">
<table cellspacing="0" cellpadding="0" style="width:600px; border-collapse:collapse; background:inherit; color:inherit">
<tbody><tr>
<td valign="center" width="200" style="padding:0px 10px 5px 5px; font-size: 12px">
<img src="/logo.png" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${user.company_id.name}">
</td>
</tr></tbody>
<field name="body_html" type="html">
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">
<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">
<span style="font-size: 10px;">Your Forum</span><br/>
<span style="font-size: 20px; font-weight: bold;">
${object.company_id.name} Forum validation
</span>
</td>
<td valign="middle" align="right">
<img src="/logo.png?company=${user.company_id.id}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${user.company_id.name}"/>
</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;">
<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="top" style="font-size: 13px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
Hello ${object.name},<br /><br />
You have been invited to validate your email in order to get access to "${object.company_id.name}" Q/A Forums.
To validate your email, please click on the following link:
<div style="margin: 16px 0px 16px 0px;">
<a href="${ctx.get('token_url')}"
style="background-color: #875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;">
Validate my account
</a>
</div>
Thanks for your participation!
</p>
</td>
</tr>
<tr>
<td 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>
<!-- FOOTER -->
<tr>
<td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style=" font-family: 'Verdana Regular'; color: #454748; min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;">
<tr>
<td valign="middle" align="left">
${user.company_id.name}
</td>
<td valign="middle" align="right" style="opacity: 0.7;">
${user.company_id.phone}
% if user.company_id.email:
| <a href="'mailto:%s' % ${user.company_id.email}" style="text-decoration:none; color: #454748;">
${user.company_id.email}
</a>
% endif
% if user.company_id.website:
| <a href="${user.company_id.website}" style="text-decoration:none; color: #454748;">
${user.company_id.website}
</a>
% endif
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td></tr>
<!-- POWERED BY -->
<tr><td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;">
<tr><td style="text-align: center; font-size: 13px;">
Powered by <a target="_blank" href="https://www.odoo.com" style="color: #875A7B;">Odoo</a>
</td></tr>
</table>
</div>
<div summary="o_mail_notification" style="padding:0px; width:600px; margin:0 auto; background: #FFFFFF repeat top /100%;color:#777777">
<table cellspacing="0" cellpadding="0" style="vertical-align:top; padding:0px; border-collapse:collapse; background:inherit; color:inherit">
<tbody><tr>
<td valign="top" style="width:600px; padding:0px 10px 5px 5px;">
<div>
<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:0px auto;padding:0">
</div>
</td>
</tr></tbody>
</table>
</div>
<div style="padding:0px; width:600px; max-width:600px; margin:0 auto; background: #FFFFFF repeat top /100%; color:#777777">
<table cellspacing="0" cellpadding="0" style="width:600px ;text-align:justify; margin:0 auto; border-collapse:collapse; background:inherit; color:inherit">
<tbody><tr>
<td style="padding:0px 10px 5px 5px;font-size: 14px;">
<p>Dear ${object.name},</p>
<p>You have been invited to validate your email in order to get access to
"${object.company_id.name}" Q/A Forums.</p>
<p>To validate your email, please click on the following link:</p>
<a style="margin-left: 15px; padding:5px 10px; border-radius: 3px; background-color:#875A7B; text-align:center; text-decoration:none; color:#F7FBFD;" href="${ctx.get('token_url')}">
Validate my account for "${object.company_id.name}" Q/A Forums
</a>
<p>Thanks for your participation!</p>
</td>
</tr></tbody>
</table>
</div>]]></field>
</td></tr>
</table>
</field>
</record>
</data>
@@ -3,29 +3,177 @@
<data>
<record id="mail_template_list_subscribe" model="mail.template">
<field name="name">Subscribe to mailing list</field>
<field name="name">Channel: Mailing list subscription</field>
<field name="model_id" ref="mail.model_mail_channel"/>
<field name="subject">Please confirm subscription to ${object.name}</field>
<field name="body_html" type="xml">
<p>Hello,</p>
<p>You have requested to be subscribed to the mailing list <strong>${object.name}</strong></p>
<p>To confirm, please visit the following link:</p>
<p><strong><a href="${ctx['token_url']}">${ctx['token_url']}</a></strong></p>
<p>If this was a mistake or you did not requested this action, please ignore this message.</p>
</field>
<field name="subject">Confirm subscription to ${object.name}</field>
<field name="body_html" type="html">
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">
<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">
<span style="font-size: 10px;">Your Channel</span><br/>
<span style="font-size: 20px; font-weight: bold;">${object.name}</span>
</td><td valign="middle" align="right">
<img src="/logo.png?company=${user.company_id.id}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${user.company_id.name}"/>
</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;">
<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="top" style="font-size: 13px;">
<div style="margin: 0px; padding: 0px;">
Hello,<br/><br/>
You have requested to be subscribed to the mailing list <strong>${object.name}</strong>.
<br/><br/>
To confirm, please visit the following link: <strong><a href="${ctx['token_url']}">${ctx['token_url']}</a></strong>
<br/><br/>
If this was a mistake or you did not requested this action, please ignore this message.
% if user.signature
<br/>
${user.signature | safe}
% endif
</div>
</td></tr>
<tr><td 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>
<!-- FOOTER -->
<tr>
<td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;">
<tr><td valign="middle" align="left">
${user.company_id.name}
</td></tr>
<tr><td valign="middle" align="left" style="opacity: 0.7;">
% if user.company_id.phone
${user.company_id.phone} |
%endif
% if user.company_id.email
<a href="'mailto:%s' % ${user.company_id.email}" style="text-decoration:none; color: #454748;">${user.company_id.email}</a> |
% endif
% if user.company_id.website
<a href="'%s' % ${user.company_id.website}" style="text-decoration:none; color: #454748;">${user.company_id.website}
</a>
% endif
</td></tr>
</table>
</td>
</tr>
</tbody>
</table>
</td></tr>
<!-- POWERED BY -->
<tr><td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;">
<tr><td style="text-align: center; font-size: 13px;">
Powered by <a target="_blank" href="https://www.odoo.com" style="color: #875A7B;">Odoo</a>
</td></tr>
</table>
</td></tr>
</table>
</field>
<field name="auto_delete" eval="True"/>
<field name="user_signature" eval="False"/>
</record>
<record id="mail_template_list_unsubscribe" model="mail.template">
<field name="name">Unsubscribe to mailing list</field>
<field name="name">Channel: Mailing list unsubscription</field>
<field name="model_id" ref="mail.model_mail_channel"/>
<field name="subject">Please confirm unsubscription to ${object.name}</field>
<field name="body_html" type="xml">
<p>Hello,</p>
<p>You have requested to be unsubscribed to the mailing list <strong>${object.name}</strong></p>
<p>To confirm, please visit the following link:</p>
<p><strong><a href="${ctx['token_url']}">${ctx['token_url']}</a></strong></p>
<p>If this was a mistake or you did not requested this action, please ignore this message.</p>
</field>
<field name="subject">Confirm unsubscription to ${object.name}</field>
<field name="body_html" type="html">
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">
<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">
<span style="font-size: 10px;">Your Channel</span><br/>
<span style="font-size: 20px; font-weight: bold;">${object.name}</span>
</td><td valign="middle" align="right">
<img src="/logo.png?company=${user.company_id.id}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${user.company_id.name}"/>
</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;">
<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="top" style="font-size: 13px;">
<div style="margin: 0px; padding: 0px;">
Hello,<br/><br/>
You have requested to be unsubscribed to the mailing list <strong>${object.name}</strong>.
<br/><br/>
To confirm, please visit the following link: <strong><a href="${ctx['token_url']}">${ctx['token_url']}</a></strong>.
<br/><br/>
If this was a mistake or you did not requested this action, please ignore this message.
% if user.signature:
<br/>
${user.signature | safe}
% endif
</div>
</td></tr>
<tr><td 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>
<!-- FOOTER -->
<tr>
<td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;">
<tr><td valign="middle" align="left">
${user.company_id.name}
</td></tr>
<tr><td valign="middle" align="left" style="opacity: 0.7;">
% if user.company_id.phone
${user.company_id.phone} |
%endif
% if user.company_id.email
<a href="'mailto:%s' % ${user.company_id.email}" style="text-decoration:none; color: #454748;">${user.company_id.email}</a> |
% endif
% if user.company_id.website
<a href="'%s' % ${user.company_id.website}" style="text-decoration:none; color: #454748;">${user.company_id.website}
</a>
% endif
</td></tr>
</table>
</td>
</tr>
</tbody>
</table>
</td></tr>
<!-- POWERED BY -->
<tr><td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;">
<tr><td style="text-align: center; font-size: 13px;">
Powered by <a target="_blank" href="https://www.odoo.com" style="color: #875A7B;">Odoo</a>
</td></tr>
</table>
</td></tr>
</table>
</field>
<field name="auto_delete" eval="True"/>
<field name="user_signature" eval="False"/>
</record>
</data>
@@ -91,62 +91,5 @@
</section>
</field>
</record>
<record id="confirmation_mail" model="mail.template">
<field name="name">Online Quote: confirmation e-mail</field>
<field name="email_from">${(object.user_id.email or object.company_id.email or 'noreply@localhost')|safe}</field>
<field name="subject">Your order ${object.name} is confirmed</field>
<field name="email_to">${ctx.get('email_to') or object.partner_id.email}</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="body_html"><![CDATA[
<div summary="o_mail_template" style="padding:0px; width:600px; margin:0 auto; background: #FFFFFF repeat top /100%;color:#777777">
<table cellspacing="0" cellpadding="0" style="width:600px; border-collapse:collapse; background:inherit; color:inherit">
<tbody><tr>
<td valign="center" width="200" style="padding:0px 10px 5px 5px;font-size: 12px">
<img src="/logo.png" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${user.company_id.name}">
</td>
</tr></tbody>
</table>
<table cellspacing="0" cellpadding="0" style="width:600px; border-collapse:collapse; background:inherit; color:inherit">
<tbody><tr>
<td valign="top" style="width:600px; padding:0px 10px 5px 5px;">
<div>
<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:15px auto;padding:0">
</div>
</td>
</tr></tbody>
</table>
</div>
<div style="padding:0px; width:600px; max-width:600px; margin:0 auto; background: #FFFFFF repeat top /100%;color:#777777">
<table cellspacing="0" cellpadding="0" style="width:600px ;text-align:justify; margin:0 auto; border-collapse:collapse; background:inherit; color:inherit">
<tbody><tr>
<td style="padding:0px 10px 5px 5px;font-size: 14px;">
<p>Dear ${object.partner_id.name},</p><br/>
<p>Your order <a href="/quote/${object.id}/${object.access_token}">${object.name}</a> has been validated!</p><br/>
% if object.partner_id.user_ids
<p>You can view your quotes, sales orders and invoices online by going to our <a style="text-decoration:none; color: #875A7B;" href="/my/home">Online Portal</a>.</p><br/>
% endif
<p>If you have any question, do not hesitate to contact us.</p><br/>
<p>Thank you for choosing ${object.company_id.name or "us"}!</p>
</td>
</tr><tr>
<td style="padding:0px 10px 5px 5px;font-size: 14px;">
% if user.signature
<p style="font-size: 14px;">${user.signature | safe}
</p>
% endif
<p style="font-size: 11px;"><strong>Sent by
<a href="${user.company_id.website}" style="text-decoration:none; color: #875A7B;">
<strong>${user.company_id.name}</strong>
</a> using <a href="www.odoo.com" style="text-decoration:none; color: #875A7B;"><strong>Odoo</strong></a>
</strong></p>
</td>
</tr></tbody>
</table>
</div>]]></field>
</record>
</data>
</odoo>
+98 -32
View File
@@ -2,44 +2,110 @@
<odoo>
<data noupdate="1">
<record id="mail_template_sale_cart_recovery" model="mail.template">
<field name="name">eCommerce: Cart Recovery Email</field>
<field name="email_from">${(object.user_id.email or '')|safe}</field>
<field name="subject">You left items in your cart.</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="name">Sale Order: Cart Recovery Email</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="auto_delete" eval="True"/>
<field name="lang">${object.partner_id.lang}</field>
<field name="subject">You left items in your cart!</field>
<field name="email_from">${(object.user_id.email or '')|safe}</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="body_html" type="xml">
<div style="margin:auto;width:100%;">
<img src="/web/image/res.company/${user.company_id.id}/logo" style="height: auto; width: 80px; margin-top:30px;" alt="${user.company_id.name}"/>
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">
<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">
% set company = object.company_id or object.user_id.company_id or user.company_id
<span style="font-size: 10px;">Your Cart</span><br/>
<span style="font-size: 20px; font-weight: bold;">
${object.name}
</span>
</td><td valign="middle" align="right">
<img src="/logo.png?company=${company.id}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${company.name}"/>
</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;">
<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="top" style="font-size: 13px;">
<h1 style="color:#A9A9A9;">THERE'S SOMETHING IN YOUR CART.</h1>
<p>Would you like to complete your purchase?</p><br/><br/>
Would you like to complete your purchase?<br/><br/>
% if object.order_line:
% for line in object.order_line:
<hr/>
<table width="100%">
<tr>
<td style="padding: 10px; width:150px;">
<img src="/web/image/product.product/${line.product_id.id}/image" height="100px" width="100px" alt="Product image"></img>
</td>
<td>
<strong>${line.product_id.display_name}</strong><br/>${line.name}
</td>
<td width="100px" align="right">
${(line.product_uom_qty) | int} ${(line.product_uom.name)}
</td>
</tr>
</table>
% endfor
<hr/>
% for line in object.order_line:
<hr/>
<table width="100%">
<tr>
<td style="padding: 10px; width:150px;">
<img src="/web/image/product.product/${line.product_id.id}/image" height="100px" width="100px" alt="Product image"></img>
</td>
<td>
<strong>${line.product_id.display_name}</strong><br/>${line.name}
</td>
<td width="100px" align="right">
${(line.product_uom_qty) | int} ${(line.product_uom.name)}
</td>
</tr>
</table>
% endfor
<hr/>
% endif
<br/><br/>
<center>
<a href="/shop/cart?access_token=${object.access_token}" target="_blank" style="background-color: #1abc9c; padding: 20px; text-decoration: none; color: #fff; border-radius: 5px; font-size: 16px;" class="o_default_snippet_text">Resume order</a><br/><br/><br/>
<p><b>Thank you for shopping with ${user.company_id.name}!</b></p>
</center>
</div>
<div style="text-align: center; margin: 16px 0px 16px 0px; font-size: 14px;">
<a href="/shop/cart?access_token=${object.access_token}"
target="_blank"
style="background-color: #875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;">
Resume order
</a>
</div>
<div style="text-align: center;"><strong>Thank you for shopping with ${user.company_id.name}!</strong></div>
</td></tr>
<tr><td 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>
<!-- FOOTER -->
<tr>
<td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;">
<tr><td valign="middle" align="left">
${company.name}
</td></tr>
<tr><td valign="middle" align="left" style="opacity: 0.7;">
${company.phone}
% if company.email
| <a href="'mailto:%s' % ${company.email}" style="text-decoration:none; color: #454748;">${company.email}</a>
% endif
% if company.website
| <a href="'%s' % ${company.website}" style="text-decoration:none; color: #454748;">${company.website}</a>
% endif
</td></tr>
</table>
</td>
</tr>
</tbody>
</table>
</td></tr>
<!-- POWERED BY -->
<tr><td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;">
<tr><td style="text-align: center; font-size: 13px;">
Powered by <a target="_blank" href="https://www.odoo.com" style="color: #875A7B;">Odoo</a>
</td></tr>
</table>
</td></tr>
</table>
</field>
<field name="lang">${object.partner_id.lang}</field>
<field name="auto_delete" eval="False"/>
<field name="user_signature" eval="False"/>
</record>
</data>
</odoo>
@@ -8,12 +8,6 @@ from odoo import api, models, fields
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
def _default_order_mail_template(self):
if self.env['ir.module.module'].search([('name', '=', 'website_quote')]).state in ('installed', 'to upgrade'):
return self.env.ref('website_quote.confirmation_mail').id
else:
return self.env.ref('sale.email_template_edi_sale').id
def _default_recovery_mail_template(self):
try:
return self.env.ref('website_sale.mail_template_sale_cart_recovery').id
@@ -40,10 +34,6 @@ class ResConfigSettings(models.TransientModel):
module_account_invoicing = fields.Boolean("Invoicing")
order_mail_template = fields.Many2one('mail.template', string='Order Confirmation Email',
default=_default_order_mail_template, domain="[('model', '=', 'sale.order')]",
help="Email sent to customer at the end of the checkout process", readonly=True)
automatic_invoice = fields.Boolean("Automatic Invoice",
help="The invoice is generated automatically and available in the customer portal "
"when the transaction is confirmed by the payment acquirer.\n"
+1 -1
View File
@@ -231,7 +231,7 @@ class SaleOrder(models.Model):
'view_id': composer_form_view_id,
'target': 'new',
'context': {
'default_composition_mode': 'mass_mail' if len(self) > 1 else 'comment',
'default_composition_mode': 'mass_mail',
'default_res_id': self.ids[0],
'default_model': 'sale.order',
'default_use_template': bool(template_id),
@@ -348,19 +348,6 @@
<h2>Orders</h2>
<div class="row mt16 o_settings_container" id="sale_checkout_settings">
<div class="col-xs-12 col-md-6 o_setting_box" id="checkout_mail_setting">
<div class="o_setting_right_pane">
<span class="o_form_label">Confirmation Email</span>
<div class="text-muted">
Email sent to the customer after the checkout
</div>
<div class="content-group">
<div class="mt16">
<field name="order_mail_template" class="oe_inline"/>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box" id="abandoned_carts_setting" title="Send a recovery email to authenticated shoppers">
<div class="o_setting_left_pane"/>
<div class="o_setting_right_pane">
@@ -16,50 +16,54 @@
<record id="slide_template_published" model="mail.template">
<field name="name">Slide Published</field>
<field name="subject">New ${object.slide_type} published on ${object.channel_id.name}</field>
<field name="model_id" ref="model_slide_slide"/>
<field name="subject">New ${object.slide_type} published on ${object.channel_id.name}</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
Hello<br/><br/>
A new ${object.slide_type} <strong>${object.name}</strong> has been published on ${object.channel_id.name} at ${format_tz(object.write_date, tz=user.tz)}
<div style="margin: 16px 8px 16px 8px; text-align: center;">
<a href="${object.website_url}">
<img alt="${object.name}" src="${ctx['base_url']}/web/image/slide.slide/${object.id}/image" style="height:auto; width:150px; margin: 16px;"/>
</a>
</div>
<div style="margin: 16px 8px 16px 8px; text-align: center;">
<a href="${object.website_url}"
style="background-color: #875a7b; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px;">View <strong>${object.name}</strong></a>
</div>
</p>
</div>
</field>
<field name="auto_delete" eval="True"/>
<field name="body_html"><![CDATA[
<p>Hello,</p>
<p>
A new ${object.slide_type} <strong>${object.name}</strong> has been published on ${object.channel_id.name} at ${format_tz(object.write_date, tz=user.tz)}
</p>
<p style="text-align: center; margin-top: 10px;">
<a href="${object.website_url}">
<img alt="${object.name}" src="${ctx['base_url']}/web/image/slide.slide/${object.id}/image" style="height:auto; width:150px; background-color: #cccccc; margin: 16px;">
</a>
</p>
<p style="text-align: center; margin-top: 10px;">
<a style="-webkit-user-select: none; padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#875A7B; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px" class="o_default_snippet_text" href="${object.website_url}">
View <strong>${object.name}</strong>
</a>
</p>
]]></field>
<field name="user_signature" eval="True"/>
</record>
<record id="slide_template_shared" model="mail.template">
<field name="name">Slide Shared</field>
<field name="subject">${user.name} shared a ${object.slide_type} with you!</field>
<field name="model_id" ref="model_slide_slide"/>
<field name="subject">${user.name} shared a ${object.slide_type} with you!</field>
<field name="email_from">${(user.email or '')|safe}</field>
<field name="email_to">${ctx['email']}</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
Hello<br/><br/>
${user.name} shared the ${object.slide_type} <strong>${object.name}</strong> with you!
<div style="margin: 16px 8px 16px 8px; text-align: center;">
<a href="${object.website_url}">
<img alt="${object.name}" src="${ctx['base_url']}/web/image/slide.slide/${object.id}/image" style="height:auto; width:150px; margin: 16px;"/>
</a>
</div>
<div style="margin: 16px 8px 16px 8px; text-align: center;">
<a href="${object.website_url}"
style="background-color: #875a7b; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px;">View <strong>${object.name}</strong></a>
</div>
</p>
</div>
</field>
<field name="auto_delete" eval="True"/>
<field name="body_html"><![CDATA[
<p>Hello,</p>
<p>
${user.name} shared the ${object.slide_type} <strong>${object.name}</strong> with you!
</p>
<p style="text-align: center; margin-top: 10px;">
<a href="${object.website_url}">
<img alt="${object.name}" src="${ctx['base_url']}/web/image/slide.slide/${object.id}/image" style="height:auto; width:150px; background-color: #cccccc; margin: 16px;">
</a>
</p>
<p style="text-align: center; margin-top: 10px;">
<a style="-webkit-user-select: none; padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#875A7B; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px" class="o_default_snippet_text" href="${object.website_url}">
View <strong>${object.name}</strong>
</a>
</p>
]]></field>
<field name="user_signature" eval="True"/>
</record>
<record model="slide.channel" id="channel_public">
+4 -2
View File
@@ -488,13 +488,15 @@ class Slide(models.Model):
slide.channel_id.message_post(
subject=subject,
body=html_body,
subtype='website_slides.mt_channel_slide_published')
subtype='website_slides.mt_channel_slide_published',
notif_layout='mail.mail_notification_light',
)
return True
@api.one
def send_share_email(self, email):
base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url')
return self.channel_id.share_template_id.with_context(email=email, base_url=base_url).send_mail(self.id)
return self.channel_id.share_template_id.with_context(email=email, base_url=base_url).send_mail(self.id, notif_layout='mail.mail_notification_light')
# --------------------------------------------------
# Parsing methods