Odoo Help


creating a report using multiple tables

on 12/10/15, 4:14 AM 910 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}"/>





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

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


<div class="row mt32 mb32">

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


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

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

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

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


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

<strong>Contact number:</strong>

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


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

<strong>Email Address:</strong>

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


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


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


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


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

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



<table class="table table-condensed">



<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>



<tbody class="sale_tbody">

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


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



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


<td class="text-right">

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


<td class="text-right">

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


<td class="text-right">

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







About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


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