Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

creating a report using multiple tables

By
wiedaad
on 12/10/15, 4:14 AM 438 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>



Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 12/10/15, 4:14 AM
Seen: 438 times
Last updated: 12/10/15, 4:26 AM