mis-builder/mis_builder/report/mis_report_instance_qweb.xml
Renzo Meister 261529aac1 apply from old repository
apply from old repository
2021-06-10 11:40:07 +02:00

123 lines
5.9 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<flectra>
<record id="qweb_pdf_export" model="ir.actions.report">
<field name="name">MIS report instance QWEB PDF report</field>
<field name="model">mis.report.instance</field>
<field name="type">ir.actions.report</field>
<field name="report_name">mis_builder.report_mis_report_instance</field>
<field name="report_type">qweb-pdf</field>
</record>
<template id="assets_report" inherit_id="web.report_assets_common">
<xpath expr="." position="inside">
<link href="/mis_builder/static/src/css/report.css" rel="stylesheet" />
</xpath>
</template>
<!--
TODO we use divs with css table layout, but this has drawbacks:
(bad layout of first column, no colspan for first header row),
consider getting back to a plain HTML table.
-->
<template id="report_mis_report_instance">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-if="o.use_external_layout">
<t t-call="web.external_layout">
<t t-call="mis_builder.report_mis_report_instance_content"/>
</t>
</t>
<t t-else="">
<t t-call="web.internal_layout">
<t t-call="mis_builder.report_mis_report_instance_content"/>
</t>
</t>
</t>
</t>
</template>
<template id="report_mis_report_instance_content">
<t t-set="matrix" t-value="o._compute_matrix()" />
<t t-set="style_obj" t-value="o.env['mis.report.style']" />
<div class="page">
<h3>
<span t-field="o.name" />
<span>-</span>
<t t-foreach="o.query_company_ids" t-as="company">
<span t-field="company.name" />
<span t-if="company != o.query_company_ids[-1]">,</span>
</t>
</h3>
<p>
<div class="mis_report_filers">
<t
t-foreach="o.get_filter_descriptions_from_context()"
t-as="filter_description"
>
<div>
<span t-esc="filter_description" />
</div>
</t>
</div>
</p>
<table class="table-condensed mis_table">
<thead>
<tr>
<th/>
<t t-foreach="matrix.iter_cols()" t-as="col">
<th class="mis_cell mis_collabel_group" t-att-colspan="len(list(col.iter_subcols()))">
<t t-esc="col.label" />
<t t-if="col.description">
<br />
<t t-esc="col.description" />
</t>
</th>
</t>
</tr>
<tr>
<th/>
<t t-foreach="matrix.iter_cols()" t-as="col">
<t t-foreach="col.iter_subcols()" t-as="subcol">
<td t-attf-class="mis_cell mis_collabel {{subcol_first and 'mis_first' or ''}}">
<t t-esc="subcol.label" />
<t t-if="subcol.description">
<br />
<t t-esc="subcol.description" />
</t>
</td>
</t>
</t>
</tr>
</thead>
<tbody>
<t t-foreach="matrix.iter_rows()" t-as="row">
<tr
t-if="not ((row.style_props.hide_empty and row.is_empty()) or row.style_props.hide_always)"
class="mis_row"
>
<td
t-att-style="style_obj.to_css_style(row.style_props)"
class="mis_cell mis_rowlabel"
>
<t t-esc="row.label" />
<t t-if="row.description">
<br />
<t t-esc="row.description" />
</t>
</td>
<t t-foreach="row.iter_cells()" t-as="cell">
<td
t-att-style="cell and style_obj.to_css_style(cell.style_props) or ''"
class="mis_cell mis_amount"
>
<t
t-esc="cell and cell.val_rendered or ''"
/>
</td>
</t>
</tr>
</t>
</tbody>
</table>
</div>
</template>
</flectra>