Odoo Help


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.


Error on printing report

willie ho
on 11/25/14, 10:11 PM 524 views

in stock.picking, i added a new one2many field for printing

class incomingShipments_picking(osv.osv):

    _inherit = 'stock.picking.in'
    _columns = {
        'summary_lines': fields.one2many('stock.move.summary', 'picking_id', 'Summary'),

class incomingshipments_summary(osv.osv):

    _name = 'stock.move.summary'
    _columns = {
        'product_id': fields.many2one('product.product', 'Product'),
        'picking_id': fields.many2one('stock.picking', 'Reference'),
        'qty': fields.integer('Quantity'),
        'state': fields.selection(
        [('draft', 'Draft'),
        ('auto', 'Waiting Another Operation'),
        ('confirmed', 'Waiting Availability'),
        ('assigned', 'Inbound'),
        ('delivered', 'Delivered'),
        ('done', 'Received'),
        ('cancel', 'Cancelled'),],
        'Status', select=True),
        'date': fields.datetime('Date', select=True, states={'done': [('readonly', True)]}),


and i added a section in my rml file:

        <para style="P1">[[repeatIn(o.summary_lines,'l')]]</para>
        <blockTable colWidths="280,255" style="Table_Order_Pur_line_Content">
                <para style="P1">[[l.product_id.name]]</para>
                <para style="P1">[[l.qty]]</para>

and it shows error

except_osv: (u'summary_lines', (<type 'exceptions.AttributeError'>, AttributeError(KeyError('summary_lines',),), <traceback object at 0x7ff9fbd47ef0>))


What should I do to solve this problem?

@Willie Does your 'o' refers to the model 'stock.picking.in', check this in your rml report

Emipro Technologies Pvt. Ltd.
on 11/26/14, 1:35 AM


| 5 3 6
Jakarta, Indonesia
On 11/26/14, 5:54 AM

For stock.picking (including stock.picking.in and stock.picking.put), you need to also define the same columns for stock.picking.  You cannot only define it for stock.picking.in or stock.picking.out.

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

2 follower(s)


Asked: 11/25/14, 10:11 PM
Seen: 524 times
Last updated: 3/16/15, 8:10 AM