openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #09795
[Bug 971713] [NEW] Bad use of pto and pto_header in RML templates
Public bug reported:
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,
** Affects: openobject-addons
Importance: Undecided
Status: New
** Tags: header lines pto report rml table
--
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):
New
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
Follow ups
-
[Bug 971713] Re: Bad use of pto and pto_header in RML templates
From: Denis Ledoux (OpenERP), 2014-04-08
-
[Bug 971713] Re: Bad use of pto and pto_header in RML templates
From: jugglefish, 2013-01-30
-
[Bug 971713] Re: Bad use of pto and pto_header in RML templates
From: Jignesh Rathod(OpenERP), 2012-05-15
-
[Bug 971713] Re: Bad use of pto and pto_header in RML templates
From: Jignesh Rathod(OpenERP), 2012-05-15
-
[Bug 971713] Re: Bad use of pto and pto_header in RML templates
From: Amit Parik (OpenERP), 2012-05-11
-
[Bug 971713] Re: Bad use of pto and pto_header in RML templates
From: Equipo OPENTIA (http://www.opentia.com), 2012-05-09
-
[Bug 971713] Re: Bad use of pto and pto_header in RML templates
From: Ravish(OpenERP), 2012-04-03
-
[Bug 971713] Re: Bad use of pto and pto_header in RML templates
From: Equipo OPENTIA (http://www.opentia.com), 2012-04-02
-
[Bug 971713] Re: Bad use of pto and pto_header in RML templates
From: Equipo OPENTIA (http://www.opentia.com), 2012-04-02
-
[Bug 971713] Re: Bad use of pto and pto_header in RML templates
From: Equipo OPENTIA (http://www.opentia.com), 2012-04-02
-
[Bug 971713] Re: Bad use of pto and pto_header in RML templates
From: Equipo OPENTIA (http://www.opentia.com), 2012-04-02
-
[Bug 971713] [NEW] Bad use of pto and pto_header in RML templates
From: Equipo OPENTIA (http://www.opentia.com), 2012-04-02
References