openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #22542
[Bug 971713] Re: Bad use of pto and pto_header in RML templates
a similar problem seems to exist for sale.order in 7.0. If you have a
long o.note that just creates a second page this will contain the
repeated table header as well.
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/971713
Title:
Bad use of pto and pto_header in RML templates
Status in OpenERP Addons (modules):
Confirmed
Bug description:
The <pto/> tag in RML templates is a flowable container. When it is
split into several pages, one can use the <pto_header/> and
<pto_trailer/> tags to show contents on top and bottom (respectively)
of each splitted area.
In openerp addons, the <story/> start (i.e. '<story>') is immediately
followed by a <pto/> start (i.e. '<pto>'), making the whole document a
flowable itself and thus using the <pto_header/> repeat on each page.
Current structure (wrong):
<document filename="Invoices.pdf">
[...]
<story>
<pto>
<para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
<para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
<pto_header><!-- Must be after setLang() -->
<blockTable colWidths="202.0,87.0,71.0,57.0,42.0,71.0" style="Table7">
<!-- pto headers table (a copy of the one that appears below -->
<tr>
<td> <para style="terp_tblheader_Details">Description</para> </td>
[...]
</tr>
</blockTable>
</pto_header>
[...]
<blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table7"> <!-- original headers table -->
[...]
<para style="terp_tblheader_General">Description</para>
[...]
</blockTable>
<section>
<para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>
<blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table8">
[...] <!-- table lines here -->
</blockTable>
</pto>
</story>
</document>
Working structure:
<document filename="Invoices.pdf">
[...]
<story>
[...]
<pto> <!-- this flowable container contains exclusively one table and headers, plus the pto_header-->
<pto_header>
<blockTable colWidths="202.0,87.0,71.0,57.0,42.0,71.0" style="Table7">
<!-- pto headers table (a copy of the one that appears below -->
<tr>
<td> <para style="terp_tblheader_Details">Description</para> </td>
[...]
</tr>
</blockTable>
</pto_header>
<blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table7"> <!-- original headers table -->
[...]
<para style="terp_tblheader_General">Description</para>
[...]
</blockTable>
<section>
<para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>
<blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table8">
[...] <!-- table lines here -->
</blockTable>
</section>
</pto>
</story>
</document>
How to reproduce the error:
Create an invoice with a number of lines that fills exactly one page
in the PDF file, leaving the taxes table in the next page. The lines
headers will appear in the taxes page, breaking the taxes table.
We attach an example of well formed RML template for account invoice
(following the previous example).
Greetings,
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/971713/+subscriptions
References