Odoo Help

0

Error on printing report

By
willie ho
on 11/25/14, 10:11 PM 694 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'),
    }
incomingShipments_picking();

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)]}),

    }
incomingshipments_summary();

and i added a section in my rml file:

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

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
0
Ivan
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.

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)

Stats

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