Odoo Help


Apply context to a one2many field

Michael Delvoye
on 2/19/15, 10:48 AM 1,125 views

Hi, i try to apply a context to a one2many field but i don't succeed in.

I create this field

_columns = {
        'order_line2': fields.one2many('sale.order.line', 'order_id', 'Order Lines', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}),


and in my xml view : 

                    <page string="DEV NEOLODGE">
                        <field     name="order_line2" context="{'group_by':'sequence'}">
                            <tree     string="Sales Order Lines" 
                                <field name="sequence" />
                                <field name="state" invisible="1"/>
                                <field name="th_weight" invisible="1"/>
                                <field name="product_id"
                                       context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
                                       on_change="product_id_change(parent.pricelist_id, product_id, product_uom_qty, False, product_uos_qty, False, name, parent.partner_id, False, True, parent.date_order, False, parent.fiscal_position, False, context)"/>





A little help would be nice.

Thanks for your help


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.


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

1 follower(s)


Asked: 2/19/15, 10:48 AM
Seen: 1125 times
Last updated: 3/16/15, 8:10 AM