mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] contract: Add contract modification
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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 <%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>
|
||||
|
||||
Reference in New Issue
Block a user