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

Error on printing report

By
willie ho
on 11/25/14, 10:11 PM 526 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

--Ivan--
3210
| 5 3 6
Jakarta, Indonesia
--Ivan--
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.

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)

Stats

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