mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
121 lines
5.4 KiB
XML
121 lines
5.4 KiB
XML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<odoo noupdate="1">
|
|
<record id="email_contract_template" model="mail.template">
|
|
<field name="name">Email Contract Template</field>
|
|
<field
|
|
name="email_from"
|
|
>${(object.user_id.email and '%s <%s>' % (object.user_id.name, object.user_id.email) or '')|safe}</field>
|
|
<field
|
|
name="subject"
|
|
>${object.company_id.name} Contract (Ref ${object.name or 'n/a'})</field>
|
|
<field name="partner_to">${object.partner_id.id}</field>
|
|
<field name="model_id" ref="model_contract_contract" />
|
|
<field name="auto_delete" eval="True" />
|
|
<field name="report_template" ref="contract.report_contract" />
|
|
<field name="report_name">Contract</field>
|
|
<field name="lang">${object.partner_id.lang}</field>
|
|
<field
|
|
name="body_html"
|
|
><![CDATA[
|
|
<div style="font-family: 'Lucida Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
|
|
<p>Hello ${object.partner_id.name or ''},</p>
|
|
<p>A new contract has been created: </p>
|
|
|
|
<p style="border-left: 1px solid #8e0000; margin-left: 30px;">
|
|
<strong>REFERENCES</strong><br />
|
|
Contract: <strong>${object.name}</strong><br />
|
|
% if object.date_start:
|
|
Contract Date Start: ${object.date_start or ''}<br />
|
|
% endif
|
|
|
|
% if object.user_id:
|
|
% if object.user_id.email:
|
|
Your Contact: <a href="mailto:${object.user_id.email or ''}?subject=Contract%20${object.name}">${object.user_id.name}</a>
|
|
% else:
|
|
Your Contact: ${object.user_id.name}
|
|
% endif
|
|
% endif
|
|
</p>
|
|
|
|
<br/>
|
|
<p>If you have any questions, do not hesitate to contact us.</p>
|
|
<p>Thank you for choosing ${object.company_id.name or 'us'}!</p>
|
|
<br/>
|
|
<br/>
|
|
<div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;">
|
|
<h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #DDD;">
|
|
<strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3>
|
|
</div>
|
|
<div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;">
|
|
<span style="color: #222; margin-bottom: 5px; display: block; ">
|
|
${object.company_id.partner_id.sudo().with_context(show_address=True, html_format=True).name_get()[0][1] | safe}
|
|
</span>
|
|
% if object.company_id.phone:
|
|
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">
|
|
Phone: ${object.company_id.phone}
|
|
</div>
|
|
% endif
|
|
% if object.company_id.website:
|
|
<div>
|
|
Web: <a href="${object.company_id.website}">${object.company_id.website}</a>
|
|
</div>
|
|
%endif
|
|
<p></p>
|
|
</div>
|
|
<p></p>
|
|
<a href="${object.get_base_url()}/my/contracts/${object.id}?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;">View contract</a>
|
|
</div>
|
|
]]></field>
|
|
</record>
|
|
<record id="mail_template_contract_modification" model="mail.template">
|
|
<field name="name">Contract Modification Template</field>
|
|
<field
|
|
name="email_from"
|
|
>${(object.user_id.email and '%s <%s>' % (object.user_id.name, object.user_id.email) or '')|safe}</field>
|
|
<field
|
|
name="subject"
|
|
>${object.company_id.name} Contract (Ref ${object.name or 'n/a'}) - Modifications</field>
|
|
<field name="model_id" ref="model_contract_contract" />
|
|
<field name="lang">${object.partner_id.lang}</field>
|
|
<field
|
|
name="body_html"
|
|
><![CDATA[
|
|
<p>Hello</p>
|
|
<p>We have modifications on the contract that we want to notify you.</p>
|
|
]]></field>
|
|
</record>
|
|
<template
|
|
id="mail_notification_contract"
|
|
inherit_id="mail.mail_notification_paynow"
|
|
primary="True"
|
|
>
|
|
<xpath expr="//t[@t-raw='message.body']" position="after">
|
|
<t t-raw="0" />
|
|
</xpath>
|
|
</template>
|
|
<template id="template_contract_modification" name="Contract Modification">
|
|
<t t-call="contract.mail_notification_contract">
|
|
<table border="1" align="center">
|
|
<thead>
|
|
<tr>
|
|
<th name="th_date">Date</th>
|
|
<th name="th_description">Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<t t-foreach="record.modification_ids" t-as="modification">
|
|
<tr t-if="not modification.sent">
|
|
<td name="td_date">
|
|
<span t-field="modification.date" />
|
|
</td>
|
|
<td name="td_description">
|
|
<div t-field="modification.description" />
|
|
</td>
|
|
</tr>
|
|
</t>
|
|
</tbody>
|
|
</table>
|
|
</t>
|
|
</template>
|
|
</odoo>
|