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

Can Multiple Delivery slip in 1 page?

By
kim
on 12/6/13, 2:37 AM 1,021 views

Hi,

Do there have anyway to make it like 1 page can have more than 1 Delivery order in there? below is my creporting file anyone can help???

picking.py

import time
from openerp.report import report_sxw
from openerp.osv import osv
from openerp import pooler

class picking(report_sxw.rml_parse):
    def __init__(self, cr, uid, name, context):
        super(picking, self).__init__(cr, uid, name, context=context)
        self.localcontext.update({
            'time': time,
            'get_product_desc':self.get_product_desc
        })
    def get_product_desc(self,move_line):
        desc = move_line.product_id.name
        if move_line.product_id.default_code:
            desc = '[' + move_line.product_id.default_code + ']' + ' ' + desc
        return desc


report_sxw.report_sxw('report.product.picking_list','stock.picking','addons/extra_reports/report/picking.rml',parser=picking)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

picking.rml

<?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="0.0" y1="57.0" width="590" height="779"/>
    </pageTemplate>
  </template>
  <stylesheet>
    <blockTableStyle id="Standard_Outline">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Table_Address_detail">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Move_Line_Header">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
      <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
      <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
      <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
      <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
      <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
      <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
      <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
    </blockTableStyle>
    <blockTableStyle id="Move_Line_Contect_Assign_State">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
      <lineStyle kind="LINEBEFORE" colorName="#000000" start="4,0" stop="4,-1"/>
      <lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
      <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
      <lineStyle kind="LINEBEFORE" colorName="#000000" start="5,0" stop="5,-1"/>
      <lineStyle kind="LINEABOVE" colorName="#000000" start="5,0" stop="5,0"/>
      <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
      <lineStyle kind="LINEBEFORE" colorName="#000000" start="6,0" stop="6,-1"/>
      <lineStyle kind="LINEAFTER" colorName="#000000" start="6,0" stop="6,-1"/>
      <lineStyle kind="LINEABOVE" colorName="#000000" start="6,0" stop="6,0"/>
      <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
    </blockTableStyle>
    <blockTableStyle id="Table1">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
      <lineStyle kind="LINEBEFORE" colorName="#000000" start="4,0" stop="4,-1"/>
      <lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
      <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
      <lineStyle kind="LINEBEFORE" colorName="#000000" start="5,0" stop="5,-1"/>
      <lineStyle kind="LINEABOVE" colorName="#000000" start="5,0" stop="5,0"/>
      <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
      <lineStyle kind="LINEBEFORE" colorName="#000000" start="6,0" stop="6,-1"/>
      <lineStyle kind="LINEAFTER" colorName="#000000" start="6,0" stop="6,-1"/>
      <lineStyle kind="LINEABOVE" colorName="#000000" start="6,0" stop="6,0"/>
      <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
    </blockTableStyle>
    <initialize>
      <paraStyle name="all" alignment="justify"/>
    </initialize>
    <paraStyle name="P1" fontName="Helvetica" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P2" fontName="Helvetica" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="6.0" spaceAfter="0.0"/>
    <paraStyle name="P3" fontName="Helvetica-Bold" fontSize="7.0" leading="9" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P5" fontName="Helvetica" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P6" fontName="Helvetica-Bold" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P7" fontName="Helvetica" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P8" fontName="Helvetica-Bold" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P9" fontName="Helvetica" fontSize="7.0" leading="9" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P10" fontName="Helvetica" fontSize="7.0" leading="9" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="7.0" leading="9" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P12" fontName="Helvetica" fontSize="7.0" leading="9" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P13" fontName="Helvetica-Bold" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P14" fontName="Helvetica" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P15" fontName="Helvetica" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P16" fontName="Helvetica-Bold" fontSize="7.0" leading="9" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="Standard" fontName="Helvetica"/>
    <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
    <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
    <paraStyle name="Index" fontName="Helvetica"/>
    <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
    <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="Table Contents" fontName="Helvetica"/>
    <paraStyle name="Footer" fontName="Helvetica"/>
    <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
    <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
    <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
    <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="terp_default_5cm_Above_Space" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="0.0"/>
    <paraStyle name="terp_default_1cm_above_space" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="3.0" spaceAfter="0.0"/>
    <images/>
  </stylesheet>
  <story>
    <para style="P15">[[repeatIn(objects,'picking')]]</para>
    <para style="P15">[[picking.type == 'out' and picking.partner_id and setLang(picking.partner_id.lang) or '']]</para>
    <blockTable colWidths="197.0,197.0,197.0" style="Table_Address_detail">
      <tr>
        <td>
          <para style="P4">Delivery Order : [[ (picking.type == 'out' or removeParentNode('para')) and '' ]] [[ picking.name ]]</para>
          <para style="P4">Sales Order : [[ picking.origin or '']]</para>
          <para style="P4">Shop : [[ picking.sale_id.shop_id.name ]]</para>
        </td>
        <td>
          <para style="P13">Contact Number:</para>
          <para style="P5">[[ picking.partner_id.phone ]]</para>
          <para style="P6">Email: </para>
          <para style="P5">[[ picking.partner_id.email]]</para>
        </td>
        <td>
          <para style="P13">Contact Address :</para>
          <para style="P5">[[ display_address(picking.partner_id) ]] </para>
        </td>
      </tr>
    </blockTable>
    <blockTable colWidths="26.0,73.0,300.0,48.0,44.0,44.0,48.0" repeatRows="1" style="Move_Line_Header">
      <tr>
        <td>
          <para style="P8">Qty</para>
        </td>
        <td>
          <para style="P8">SKU</para>
        </td>
        <td>
          <para style="P8">Description</para>
        </td>
        <td>
          <para style="P11">Weight</para>
        </td>
        <td>
          <para style="P11">Picked</para>
        </td>
        <td>
          <para style="P3">Packed</para>
        </td>
        <td>
          <para style="P3">Exception</para>
        </td>
      </tr>
    </blockTable>
    <section>
      <para style="P1">[[ repeatIn([line for line in picking.move_lines if (line.state == 'confirmed' or line.state=='done' or line.state=='assigned')],'move_lines') ]]</para>
      <para style="P1">[[ (picking.move_lines!=[] and removeParentNode('para')) or removeParentNode('section')]]</para>
      <blockTable colWidths="26.0,73.0,300.0,48.0,44.0,44.0,48.0" style="Move_Line_Contect_Assign_State">
        <tr>
          <td>
            <para style="P9">[[ formatLang(move_lines.product_qty) ]] [[ move_lines.product_uom.name ]]</para>
          </td>
          <td>
            <para style="P5">[[ (move_lines.product_id.default_code) ]] </para>
          </td>
          <td>
            <para style="P14">[[ (move_lines.product_id.name) ]]</para>
          </td>
          <td>
            <para style="P5">[[ move_lines.weight ]]</para>
          </td>
          <td>
            <para style="P5">
              <font color="white"> </font>
            </para>
          </td>
          <td>
            <para style="P9">
              <font color="white"> </font>
            </para>
          </td>
          <td>
            <para style="P9">
              <font color="white"> </font>
            </para>
          </td>
        </tr>
      </blockTable>
    </section>
    <para style="P13">[[ ([line for line in picking.move_lines if (line.state == 'draft' or line.state=='waiting' )]) and 'Non Assigned Products:' or removeParentNode('para') ]]</para>
    <para style="P1"/>
    <section>
      <para style="P1">[[ repeatIn([line for line in picking.move_lines if (line.state == 'draft' or line.state=='waiting')],'move_lines') ]]</para>
      <para style="P1">[[ (picking.move_lines!=[] and removeParentNode('para')) or removeParentNode('section')]]</para>
      <blockTable colWidths="26.0,73.0,300.0,48.0,44.0,44.0,47.0" style="Table1">
        <tr>
          <td>
            <para style="P9">[[ formatLang(move_lines.product_qty) ]] [[ move_lines.product_uom.name ]]</para>
          </td>
          <td>
            <para style="P5">[[ (move_lines.product_id.default_code) ]] </para>
          </td>
          <td>
            <para style="P14">[[ (move_lines.product_id.name) ]]</para>
          </td>
          <td>
            <para style="P5">[[ move_lines.weight ]]</para>
          </td>
          <td>
            <para style="P5">
              <font color="white"> </font>
            </para>
          </td>
          <td>
            <para style="P9">
              <font color="white"> </font>
            </para>
          </td>
          <td>
            <para style="P9">
              <font color="white"> </font>
            </para>
          </td>
        </tr>
      </blockTable>
    </section>
    <para style="P1">
      <font color="white"> </font>
    </para>
  </story>
</document>

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

0 follower(s)

Stats

Asked: 12/6/13, 2:37 AM
Seen: 1021 times
Last updated: 3/16/15, 8:10 AM