← Back to team overview

openerp-community-reviewer team mailing list archive

[Bug 971713] Re: Bad use of pto and pto_header in RML templates

 

** Changed in: openobject-addons
       Status: Confirmed => Fix Released

** Changed in: ocb-addons/7.0
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of OpenERP
Community Backports Team, which is subscribed to OpenERP Community
Backports (Addons).
https://bugs.launchpad.net/bugs/971713

Title:
  Bad use of pto and pto_header in RML templates

Status in OpenERP Community Backports (Addons):
  Fix Released
Status in OpenERP Community Backports (Addons) 6.1 series:
  Fix Released
Status in OpenERP Community Backports (Addons) 7.0 series:
  Fix Released
Status in OpenERP Addons (modules):
  Fix Released
Status in Therp Backports (Deprecated):
  Fix Released
Status in Therp Backports (Deprecated) addons-6.1 series:
  Fix Released

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/ocb-addons/+bug/971713/+subscriptions