Files
contract/agreement_legal/report/agreement.xml
Patrick Wilson 5736d92ace [14.0][MIG] agreement_legal (Version 12.0 to 14.0)
[MIG] Black & Cleanup

[IMP] Reviewer Requested Changes

[IMP] Black

[IMP] Reviewer Suggestion

[FIX] Tests

[FIX] Multiple Issues

- Added 'is_old_version' field to better display old versions. Before these were marked as inactive therefore not showing in the agreement.
- 'is_template' field now copies when making a template revision or copying a template.
- New Versions now retain original create date.
- Moved version/revision and created on/by fields out of footer to top in order to have the save buttons when creating children.
- Moved demo data out of data folder into the demo.xml

[FIX] demo data

[FIX] Revert back to only migration

[FIX] Report dynamic field rendering

[FIX] Test
2021-06-29 09:17:58 -06:00

180 lines
9.3 KiB
XML

<odoo>
<record id="partner_agreement_contract_document" model="ir.actions.report">
<field name="name">Agreement</field>
<field name="model">agreement</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">agreement_legal.report_agreement_document</field>
<field name="report_file">agreement_legal.report_agreement_document</field>
</record>
<record id="partner_agreement_contract_document_preview" model="ir.actions.report">
<field name="name">Agreement Preview</field>
<field name="model">agreement</field>
<field name="report_type">qweb-html</field>
<field name="report_name">agreement_legal.report_agreement_document</field>
<field name="report_file">agreement_legal.report_agreement_document</field>
</record>
<template id="report_agreement_document">
<t t-name="agreement.report_agreement_document">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="doc">
<t t-call="web.external_layout">
<div class="page">
<h1 t-field="doc.name" />
<div name="description">
<span t-field="doc.dynamic_description" />
</div>
<h2>Parties</h2>
<div name="parties">
<t t-if="doc.use_parties_content">
<p t-field="doc.dynamic_parties" />
</t>
</div>
<t t-if="not doc.use_parties_content">
<h3>Company Information</h3>
<div name="company_address">
<address
t-field="doc.company_id.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'
/>
</div>
<div name="company_contact">
Represented by <span
t-field="doc.company_contact_id.name"
/>.
</div>
<h3>Partner Information</h3>
<div name="partner_address">
<address
t-field="doc.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'
/>
</div>
<div name="partner_contact">
Represented by <span
t-field="doc.partner_contact_id.name"
/>.
</div>
</t>
<h2>Agreement</h2>
<h3>Recitals</h3>
<table class="table table-condensed">
<tbody>
<tr>
<td>
<ol>
<li
t-foreach="doc.recital_ids"
t-as="r"
>
<t t-if="r.title">
<h3 t-field="r.title" />
</t>
<p t-field="r.dynamic_content" />
</li>
</ol>
</td>
</tr>
</tbody>
</table>
<table class="table table-condensed">
<tbody class="section_tbody">
<tr>
<td>
<ol>
<li
t-foreach="doc.sections_ids"
t-as="s"
>
<t t-if="s.title">
<h3 t-field="s.title" />
</t>
<p t-field="s.dynamic_content" />
<ol>
<li
t-foreach="s.clauses_ids"
t-as="c"
>
<t t-if="c.title">
<h4 t-field="c.title" />
</t>
<p
t-field="c.dynamic_content"
/>
</li>
</ol>
</li>
</ol>
</td>
</tr>
</tbody>
</table>
<t t-if="special_term">
<h2>Special Terms</h2>
<div name="special_term">
<p t-field="doc.dynamic_special_terms" />
</div>
</t>
<h2>Signatures</h2>
<table class="table table-condensed">
<theader>
<tr>
<th>Partner</th>
<th>Company</th>
</tr>
</theader>
<tbody class="section_tbody">
<tr>
<td>
<p t-field="doc.partner_id" />
<p>By: </p>
<p>
Name: <span
t-field="doc.partner_contact_id.name"
/>
</p>
<p>
Title: <span
t-field="doc.partner_contact_id.function"
/>
</p>
<p>Date: </p>
</td>
<td>
<p t-field="doc.company_id.partner_id" />
<p>By: </p>
<p>
Name: <span
t-field="doc.company_contact_id.name"
/>
</p>
<p>
Title: <span
t-field="doc.company_contact_id.function"
/>
</p>
<p>Date: </p>
</td>
</tr>
</tbody>
</table>
</div>
<div t-foreach="doc.appendix_ids" t-as="a">
<div class="page">
<h1
t-field="a.title"
style="page-break-before: always;"
/>
<p t-field="a.dynamic_content" />
</div>
</div>
</t>
</t>
</t>
</t>
</template>
</odoo>