[IMP] contract: Add contract modification

This commit is contained in:
Víctor Martínez
2020-12-28 09:47:21 +01:00
parent 378a0da5cc
commit aa5f72c734
15 changed files with 620 additions and 2372 deletions

View File

@@ -4,4 +4,12 @@
<field name="name">Invoice created</field>
<field name="res_model">contract.contract</field>
</record>
<record
id="mail_message_subtype_contract_modification"
model="mail.message.subtype"
>
<field name="name">Contract modifications</field>
<field name="res_model">contract.contract</field>
<field name="default" eval="False" />
</record>
</odoo>

View File

@@ -67,4 +67,54 @@
</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 &lt;%s&gt;' % (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>