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

Create new picking list report [Closed]

By
kim
on 12/3/13, 4:28 AM 2,281 views

The Question has been closed for reason: duplicate question

by
Daniel Reis
on 12/03/2013 05:25:02

Hi,

I create new report module for the warehouse delivery order picking list but when i pick it it show the error message

Field 'move_lines' does not exist in object 'browse_record(product.product, 1)' (<type 'exceptions.attributeerror'="">, AttributeError(KeyError("Field 'move_lines' does not exist in object 'browse_record(product.product, 1)'",),), <traceback object="" at="" 0x7ff9172497e8="">)

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

class product_moves(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_moves', 'stock.picking', 'addons/extra_reports/reports/product_moves.rml', parser=product_moves)

product_moves.rml <document filename="Packing List.pdf"> <template pagesize="(595.0,842.0)" title="Packing List" author="OpenERP S.A.(sales@openerp.com)" allowsplitting="20"> <pagetemplate id="first"> <frame id="first" x1="0.0" y1="57.0" width="538" height="728"/> </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="Table_Title_String"> <blockalignment value="LEFT"/> <blockvalign value="TOP"/> </blocktablestyle> <blocktablestyle id="Header_Order_Reference_Tbl"> <blockalignment value="LEFT"/> <blockvalign value="TOP"/> <linestyle kind="LINEBEFORE" colorname="#e6e6e6" start="0,0" stop="0,-1"/> <linestyle kind="LINEABOVE" colorname="#e6e6e6" start="0,0" stop="0,0"/> <linestyle kind="LINEBELOW" colorname="#e6e6e6" start="0,-1" stop="0,-1"/> <linestyle kind="LINEBEFORE" colorname="#e6e6e6" start="1,0" stop="1,-1"/> <linestyle kind="LINEABOVE" colorname="#e6e6e6" start="1,0" stop="1,0"/> <linestyle kind="LINEBELOW" colorname="#e6e6e6" start="1,-1" stop="1,-1"/> <linestyle kind="LINEBEFORE" colorname="#e6e6e6" start="2,0" stop="2,-1"/> <linestyle kind="LINEABOVE" colorname="#e6e6e6" start="2,0" stop="2,0"/> <linestyle kind="LINEBELOW" colorname="#e6e6e6" start="2,-1" stop="2,-1"/> <linestyle kind="LINEBEFORE" colorname="#e6e6e6" start="3,0" stop="3,-1"/> <linestyle kind="LINEABOVE" colorname="#e6e6e6" start="3,0" stop="3,0"/> <linestyle kind="LINEBELOW" colorname="#e6e6e6" start="3,-1" stop="3,-1"/> <linestyle kind="LINEBEFORE" colorname="#e6e6e6" start="4,0" stop="4,-1"/> <linestyle kind="LINEAFTER" colorname="#e6e6e6" start="4,0" stop="4,-1"/> <linestyle kind="LINEABOVE" colorname="#e6e6e6" start="4,0" stop="4,0"/> <linestyle kind="LINEBELOW" colorname="#e6e6e6" start="4,-1" stop="4,-1"/> </blocktablestyle> <blocktablestyle id="Content_Order_Reference_Table"> <blockalignment value="LEFT"/> <blockvalign value="TOP"/> <linestyle kind="LINEBEFORE" colorname="#e6e6e6" start="0,0" stop="0,-1"/> <linestyle kind="LINEABOVE" colorname="#e6e6e6" start="0,0" stop="0,0"/> <linestyle kind="LINEBELOW" colorname="#e6e6e6" start="0,-1" stop="0,-1"/> <linestyle kind="LINEBEFORE" colorname="#e6e6e6" start="1,0" stop="1,-1"/> <linestyle kind="LINEABOVE" colorname="#e6e6e6" start="1,0" stop="1,0"/> <linestyle kind="LINEBELOW" colorname="#e6e6e6" start="1,-1" stop="1,-1"/> <linestyle kind="LINEBEFORE" colorname="#e6e6e6" start="2,0" stop="2,-1"/> <linestyle kind="LINEABOVE" colorname="#e6e6e6" start="2,0" stop="2,0"/> <linestyle kind="LINEBELOW" colorname="#e6e6e6" start="2,-1" stop="2,-1"/> <linestyle kind="LINEBEFORE" colorname="#e6e6e6" start="3,0" stop="3,-1"/> <linestyle kind="LINEABOVE" colorname="#e6e6e6" start="3,0" stop="3,0"/> <linestyle kind="LINEBELOW" colorname="#e6e6e6" start="3,-1" stop="3,-1"/> <linestyle kind="LINEBEFORE" colorname="#e6e6e6" start="4,0" stop="4,-1"/> <linestyle kind="LINEAFTER" colorname="#e6e6e6" start="4,0" stop="4,-1"/> <linestyle kind="LINEABOVE" colorname="#e6e6e6" start="4,0" stop="4,0"/> <linestyle kind="LINEBELOW" colorname="#e6e6e6" start="4,-1" stop="4,-1"/> </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"/> </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="LINEBELOW" colorname="#e6e6e6" start="4,-1" stop="4,-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="LINEBELOW" colorname="#e6e6e6" start="4,-1" stop="4,-1"/> </blocktablestyle> <blocktablestyle id="Table2"> <blockalignment value="LEFT"/> <blockvalign value="TOP"/> <linestyle kind="LINEABOVE" colorname="#000000" start="1,0" stop="1,0"/> <linestyle kind="LINEABOVE" colorname="#000000" start="2,0" stop="2,0"/> </blocktablestyle> <initialize> <parastyle name="all" alignment="justify"/> </initialize> <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> <pto> <pto_header> <blocktable colwidths="256.0,73.0,59.0,59.0,71.0" repeatrows="1" style="Move_Line_Header"> <para style="terp_tblheader_Details">Description</para> <para style="terp_tblheader_Details_Centre">Lot</para> <para style="terp_tblheader_Details_Centre">Status</para> <para style="terp_tblheader_Details_Right">Location</para> <para style="terp_tblheader_Details_Right">Quantity</para> </blocktable> </pto_header> <para style="terp_default_8">[[repeatIn(objects,'picking')]] </para> <para style="terp_default_8">[[picking.type == 'out' and picking.partner_id and setLang(picking.partner_id.lang) or '']]</para> <para style="terp_default_9"> </para> <blocktable colwidths="269.0,269.0" style="Table_Address_detail"> <para style="terp_default_Bold_9">Supplier Address : [[ (picking.type == 'in' or removeParentNode('para')) and '' ]]</para> <para style="terp_default_Bold_9">Customer Address : [[ (picking.type == 'out' or removeParentNode('para')) and '' ]]</para> <para style="terp_default_Bold_9">Warehouse Address : [[ (picking.type == 'internal' or removeParentNode('para')) and '' ]]</para> <para style="terp_default_9">[[ (picking.partner_id and picking.partner_id.id and picking.partner_id.title.name) or '' ]] [[ picking.partner_id and picking.partner_id.id and picking.partner_id.name ]]</para> <para style="terp_default_9">[[ picking.partner_id and display_address(picking.partner_id) ]]</para> <para style="terp_default_9">[[ picking.partner_id.phone or picking.partner_id.email or removeParentNode('para')]]</para> <para style="terp_default_Bold_9">Contact Address :</para> <para style="terp_default_9">[[ picking.partner_id and picking.partner_id.title.name or '' ]] [[ picking.partner_id and picking.partner_id.name or '' ]]</para> <para style="terp_default_9">[[ picking.partner_id and display_address(picking.partner_id) ]] </para> <para style="terp_default_9">[[ picking.partner_id.phone or picking.partner_id.email or removeParentNode('para')]]</para> </blocktable> <para style="terp_default_5cm_Above_Space"> </para> <para style="terp_default_5cm_Above_Space"> </para> <blocktable colwidths="538.0" style="Table_Title_String"> <para style="terp_header">Delivery Order 123: [[ (picking.type == 'out' or removeParentNode('para')) and '' ]] [[ picking.name ]]</para> <para style="terp_header">Incoming Shipment : [[ (picking.type == 'in' or removeParentNode('para')) and '' ]] [[ picking.name ]]</para> <para style="terp_header">Internal Shipment : [[ (picking.type == 'internal' or removeParentNode('para')) and '' ]] [[ picking.name ]]</para> </blocktable> <para style="terp_default_5cm_Above_Space"> </para> <blocktable colwidths="100.0,154.0,161.0,109.0" style="Header_Order_Reference_Tbl"> <para style="terp_tblheader_General_Centre">Journal</para> <para style="terp_tblheader_General_Centre">Order(Origin)</para> <para style="terp_tblheader_General_Centre">Schedule Date</para> <para style="terp_tblheader_General_Centre">Weight</para> </blocktable> <blocktable colwidths="100.0,154.0,162.0,109.0" style="Content_Order_Reference_Table"> <para style="terp_default_Centre_8">[[ picking.stock_journal_id.name]]</para> <para style="terp_default_Centre_8">[[ picking.origin or '']]</para> <para style="terp_default_Centre_8">[[ formatLang(picking.min_date,date_time = True) ]]</para> <para style="terp_default_Centre_8">[[ 'weight' in picking._columns.keys() and picking.weight or '']]</para> </blocktable> <para style="terp_default_5cm_Above_Space"> </para> <blocktable colwidths="256.0,73.0,59.0,59.0,71.0" repeatrows="1" style="Move_Line_Header"> <para style="terp_tblheader_Details">Description</para> <para style="terp_tblheader_Details_Centre">Serial Number</para> <para style="terp_tblheader_Details_Centre">Status</para> <para style="terp_tblheader_Details_Right">Location</para> <para style="terp_tblheader_Details_Right">Quantity</para> </blocktable> <section> <para style="terp_default_2">[[ repeatIn([line for line in picking.move_lines if ((line.state == 'confirmed' or line.state=='done' or line.state=='assigned') and not line.scrapped)],'move_lines') ]]</para> <para style="terp_default_2">[[ (picking.move_lines!=[] and removeParentNode('para')) or removeParentNode('section')]]</para> <blocktable colwidths="256.0,74.0,58.0,60.0,73.0" style="Move_Line_Contect_Assign_State"> <para style="terp_default_9">[[ get_product_desc(move_lines) ]] </para> <para style="terp_default_Centre_9">[[ (move_lines.prodlot_id and move_lines.prodlot_id.name) or '' ]]</para> <para style="terp_default_9">[[ move_lines.state ]]</para> <para style="terp_default_Right_9">[[ (move_lines.location_id and move_lines.location_id.name) or '' ]] </para> <para style="terp_default_Right_9">[[ formatLang(move_lines.product_qty) ]] [[ move_lines.product_uom.name ]]</para> </blocktable> </section> <para style="terp_default_Bold_9">[[ ([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="terp_default_2"/> <section> <para style="terp_default_2">[[ repeatIn([line for line in picking.move_lines if (line.state == 'draft' or line.state=='waiting')],'move_lines') ]]</para> <para style="terp_default_2">[[ (picking.move_lines!=[] and removeParentNode('para')) or removeParentNode('section')]]</para> <blocktable colwidths="256.0,74.0,57.0,61.0,72.0" style="Table1"> <para style="terp_default_9">[[ get_product_desc(move_lines) ]] </para> <para style="terp_default_Centre_9">[[ (move_lines.prodlot_id and move_lines.prodlot_id.name) or '' ]]</para> <para style="terp_default_9">[[ (picking.type == 'in' or removeParentNode('para')) ]][[ move_lines.state == 'done' and 'Received' or move_lines.state]]</para> <para style="terp_default_9">[[ (picking.type == 'out' or removeParentNode('para')) ]][[ move_lines.state == 'done' and 'Delivered' or move_lines.state]]</para> <para style="terp_default_9">[[ (picking.type == 'internal' or removeParentNode('para')) ]][[ move_lines.state == 'done' and 'Transferred' or move_lines.state]]</para> <para style="terp_default_Right_9">[[ (move_lines.location_id and move_lines.location_id.name) or '' ]] </para> <para style="terp_default_Right_9">[[ formatLang(move_lines.product_qty) ]] [[ move_lines.product_uom.name ]]</para> </blocktable> </section> <para style="terp_default_2"> </para> </pto> </story> </document>

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/3/13, 4:28 AM
Seen: 2281 times
Last updated: 3/16/15, 8:10 AM