<?xml version="1.0"?>
<document filename="test.pdf">
  <template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
    <pageTemplate id="first">
      <frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
    </pageTemplate>
  </template>
  <stylesheet>
    <blockTableStyle id="Standard_Outline">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Table1">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
      <lineStyle kind="GRID" colorName="black"/>
    </blockTableStyle>
    <blockTableStyle id="Table2">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Table3">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
      <lineStyle kind="GRID" colorName="black"/>
      <blockBackground colorName="#808080" start="0,0" stop="0,0"/>
      <blockBackground colorName="#808080" start="1,0" stop="1,0"/>
      <blockBackground colorName="#808080" start="2,0" stop="2,0"/>
      <blockBackground colorName="#808080" start="3,0" stop="3,0"/>
    </blockTableStyle>
    <blockTableStyle id="Table4">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
      <lineStyle kind="GRID" colorName="black"/>
      <blockBackground colorName="#cccccc" start="0,0" stop="0,0"/>
      <blockBackground colorName="#cccccc" start="1,0" stop="1,0"/>
      <blockBackground colorName="#cccccc" start="2,0" stop="2,0"/>
      <blockBackground colorName="#cccccc" start="3,0" stop="3,0"/>
    </blockTableStyle>
    <initialize>
      <paraStyle name="all" alignment="justify"/>
    </initialize>
    <paraStyle name="P1" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="CENTER"/>
    <paraStyle name="P2" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="CENTER"/>
    <paraStyle name="P3" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="CENTER"/>
    <paraStyle name="P4" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="LEFT"/>
    <paraStyle name="P5" fontName="Times-Roman"/>
    <paraStyle name="P6" fontName="Times-Roman" fontSize="10.0" leading="13"/>
    <paraStyle name="P7" fontName="Times-Roman" fontSize="10.0" leading="13"/>
    <paraStyle name="P8" fontName="Times-Bold" fontSize="8.0" leading="10" alignment="CENTER"/>
    <paraStyle name="P9" fontName="Times-Bold" fontSize="8.0" leading="10" alignment="CENTER"/>
    <paraStyle name="P10" fontName="Times-Roman" fontSize="8.0" leading="10" alignment="CENTER"/>
    <paraStyle name="P11" fontName="Times-Roman" fontSize="7.0" leading="9"/>
    <paraStyle name="P12" fontName="Times-Roman" fontSize="8.0" leading="10" alignment="CENTER"/>
    <paraStyle name="P13" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P14" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="LEFT"/>
    <paraStyle name="P15" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="RIGHT"/>
    <paraStyle name="P16" fontName="Times-Roman" fontSize="8.0" leading="10" alignment="LEFT"/>
    <paraStyle name="P17" fontName="Times-Roman" fontSize="8.0" leading="10" alignment="LEFT"/>
    <paraStyle name="P18" fontName="Times-Roman" fontSize="6.0" leading="8"/>
    <paraStyle name="P19" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="Standard" fontName="Times-Roman"/>
    <paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="Footer" fontName="Times-Roman"/>
    <paraStyle name="Table Contents" fontName="Times-Roman"/>
    <paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER"/>
    <paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
  </stylesheet>
  <story>
    <para style="P1">[[ repeatIn(objects, 'o') ]]</para>
    <para style="P2">Delivery order [[ o.sale_id.name ]]</para>
    <para style="P3">
      <font color="white"> </font>
    </para>
    <para style="P4">[[ not(o.sale_id) and 'Error, no sale order attached to this picking !' or '' ]]</para>
    <blockTable colWidths="241.0,241.0" repeatRows="1" style="Table1">
      <tr>
        <td>
          <para style="P5">Invoiced to</para>
          <para style="P6">[[ o.sale_id.partner_invoice_id.partner_id.name ]]</para>
          <para style="P7">[[ o.sale_id.partner_invoice_id.street ]]</para>
          <para style="P7">[[ o.sale_id.partner_invoice_id.zip ]] [[ o.sale_id.partner_invoice_id.city ]]</para>
          <para style="P7">[[ o.sale_id.partner_invoice_id.country_id and o.sale_id.partner_invoice_id.country_id.name ]]</para>
        </td>
        <td>
          <para style="P5">Shipped to</para>
          <para style="P6">[[ o.sale_id.partner_shipping_id.partner_id.name ]]</para>
          <para style="P7">[[ o.sale_id.partner_shipping_id.street ]]</para>
          <para style="P7">[[ o.sale_id.partner_shipping_id.zip ]] [[ o.sale_id.partner_shipping_id.city ]][[ o.sale_id.partner_shipping_id.country_id and o.sale_id.partner_shipping_id.country_id.name ]]</para>
        </td>
      </tr>
    </blockTable>
    <para style="Standard">
      <font color="white"> </font>
    </para>
    <blockTable colWidths="106.0,121.0,120.0,134.0" repeatRows="1" style="Table2">
      <tr>
        <td>
          <para style="P8">Order ref.</para>
        </td>
        <td>
          <para style="P9">Order date</para>
        </td>
        <td>
          <para style="P9">Shipping date</para>
        </td>
        <td>
          <para style="P9">Carrier</para>
        </td>
      </tr>
      <tr>
        <td>
          <para style="P10">[[ o.sale_id.name ]]</para>
        </td>
        <td>
          <para style="P10">[[ o.sale_id.date_order ]]</para>
        </td>
        <td>
          <para style="P10">[[ o.date ]]</para>
        </td>
        <td>
          <para style="P10">[[ o.carrier_id and o.carrier_id.name or '' ]]</para>
        </td>
      </tr>
    </blockTable>
    <para style="P11">
      <font color="white"> </font>
    </para>
    <blockTable colWidths="93.0,244.0,85.0,60.0" repeatRows="1" style="Table3">
      <tr>
        <td>
          <para style="P12">Reference</para>
        </td>
        <td>
          <para style="P12">Designation</para>
        </td>
        <td>
          <para style="P12">Quantity</para>
        </td>
        <td>
          <para style="P12">S.U.</para>
        </td>
      </tr>
    </blockTable>
    <section>
      <para style="P13">[[ repeatIn(o.move_lines, 'line') ]]</para>
      <blockTable colWidths="93.0,244.0,85.0,59.0" style="Table4">
        <tr>
          <td>
            <para style="P14">[[line.product_id.code]]</para>
          </td>
          <td>
            <para style="P14">[[line.product_id.name]]</para>
          </td>
          <td>
            <para style="P15">[[line.product_qty]]</para>
          </td>
          <td>
            <para style="P14">[[line.product_uom.name]]</para>
          </td>
        </tr>
        <tr>
          <td>
            <para style="P16">[[line.product_id.ean13]]</para>
          </td>
          <td>
            <para style="P16">Logistical unit : [[line.product_packaging.qty]]</para>
            <para style="P16">[[line.tracking_id and 'Packaging : %d package of %d P' % (1, line.product_packaging.qty) or '']]</para>
            <para style="P16">[[line.tracking_id and 'Pallets reference: %s' % line.tracking_id.name or '']] Batch reference : [[ line.prodlot_id and line.prodlot_id.name or '/' ]]</para>
          </td>
          <td>
            <para style="P16">[[ line.product_uos_qty ]]</para>
          </td>
          <td>
            <para style="P17">[[line.product_uos.name]]</para>
          </td>
        </tr>
      </blockTable>
      <para style="P18">
        <font color="white"> </font>
      </para>
    </section>
    <para style="P19">
      <font color="white"> </font>
    </para>
  </story>
</document>

