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

Problem with QWeb report

By
José
on 3/30/15, 4:06 PM 1,182 views

Hello, I have Odoo 8 and I am developing a QWeb report.

This is my code where I call the report:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report
id="report_facturacion_quincenal"
string="Detalle ventas"
model="sale.order"
report_type="qweb-pdf"
file="x_transporte.rep_facturacion_quincenal"
name="x_transporte.rep_facturacion_quincenal"
/>
</data>
</openerp>

In the x_transporte.rep_facturacion_quincenal.xml file I have this code

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_view_facturacion_quincenal">
<t t-call="report.external_layout">
<div class="page">
<div class="oe_structure"/>
<div class="row">
<h2>Detalle de ventas</h2>
</div>

<table class="table table-condensed">
<thead>
<tr>
<th>Fecha</th>
<th>Documento</th>
<th>Detalle</th>
</tr>
</thead>
<tbody class="sale_tbody">
<tr t-foreach="o" t-as="l">
<td>...
........
</div>
</t>
</template>

<template id="rep_facturacion_quincenal">
<t t-call="report.html_container">
<t t-foreach="doc_ids" t-as="doc_id">
<t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'x_transporte.report_view_facturacion_quincenal')"/>
</t>
</t>
</template>
</data>
</openerp>


When I select more than one sale order, and print the report, the system generates one sheet per sale order. I want to print all the sale orders in the same sheet (if the space is enough, of course). How can I do that? Thanks!

1

Vasanth

--Vasanth--
3458
| 5 3 8
Pondicherry, India
--Vasanth--
Vasanth
On 3/31/15, 2:32 AM

the code <div class="page"> make to print the report in one sheet per each page. So you have to change the base code of the "page" calss to change this according to your requirement.

0
virbhadrasinh
On 5/28/15, 3:29 AM

You should try this


-----------1-------------------

<openerp>

<data>

<report

id="report_facturacion_quincenal"

string="Detalle ventas"

model="sale.order"

report_type="qweb-pdf"

file="x_transporte.report_view_facturacion_quincenal"

name="x_transporte.report_view_facturacion_quincenal"

/>

</data>

</openerp>

-------------------2------------------


<?xml version="1.0" encoding="utf-8"?>

<openerp>

<data>

<template id="report_view_facturacion_quincenal">

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

<div class="page">

<div class="oe_structure"/>

<div class="row">

<h2>Detalle de ventas</h2>

</div>

<table class="table table-condensed">

<thead>

<tr>

<th>Fecha</th>

<th>Documento</th>

<th>Detalle</th>

</tr>

</thead>

<tbody class="sale_tbody">

<t t-foreach="docs" t-as="o">

<td>

</td>

</tr>

</tbody>

</div>

</t>

</template>

</data>

</openerp>

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: 3/30/15, 4:06 PM
Seen: 1182 times
Last updated: 5/28/15, 3:29 AM