This question has been flagged
5695 Views

HI there, I am new to this reporting thing,actually I am trying to write my very first qweb report.I have a res partner table that is linked to a res permit table. These tables are linked by id and partner_id. I want to create a report where I print the partner info with all the permits linked to his name. The first half of my report was pretty easy printing the info. I am completey stuck with the printing of the permits.

This is my code i have used.

<?xml version="1.0"?>

<t t-name="res.details_report_document">

<t t-call="report.external_layout">

<div class="page">

<div class="row">

<div class="col-xs-5 col-xs-offset-7">

<address t-field="o.id" t-field-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: true}"/>

</div>

</div>

</div>

<h2>

<span t-field="o.name"/>

<span t-field="o.x_id_number"/>

</h2>

<div class="row mt32 mb32">

<div class="col-xs-2" t-if="o.name">

<strong>Address:</strong>

<p t-field="o.street"/>

<p t-field="o.street2"/>

<p t-field="o.city"/>

<p t-field="o.zip"/>

</div>

<div class="col-xs-2" t-if="o.mobile">

<strong>Contact number:</strong>

<p t-field="o.mobile"/>

</div>

<div class="col-xs-2" t-if="o.email">

<strong>Email Address:</strong>

<p t-field="o.email"/>

</div>

<div class="col-xs-2" t-if="o.fax">

<strong>Fax:</strong>

<p t-field="o.fax"/>

</div>

<div class="col-xs-2" t-if="o.verified">

<strong>Verified:</strong>

<p t-field="o.verified"/>

<p t-field="o.verify_date"/>

</div>

</div>

<table class="table table-condensed">

<thead>

<tr>

<th>Permit Number</th>

<th>Permit Holder</th>

<th class="text-right">Operating Area</th>

<th class="text-right">Issue Date</th>

<th class="text-right">Expiry Date</th>

</tr>

</thead>

<tbody class="sale_tbody">

<tr t-foreach="o.id" t-as="l">

<td>

<span t-field="l.name"/>

</td>

<td>

<span t-esc="', '.join(map(lambda x: x.name, l.partner_id))"/>

</td>

<td class="text-right">

<span t-field="l.operatoring_area"/>

</td>

<td class="text-right">

<span t-field="l.start_date"/>

</td>

<td class="text-right">

<span t-field="l.end_date"/>

</td>

</tr>

</tbody>

</table>

</t>

</t>



Avatar
Discard