This question has been flagged

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" 
                                    editable="bottom" 
                                    toolbar="1" 
                                    colors="blue:sequence==10;red:sequence==20;"                                      
                            > 
                            
                            
                                <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}"
                                       groups="base.group_user" 
                                       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

MDEL

Avatar
Discard