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

Apply context to a one2many field

By
Michael Delvoye
on 2/19/15, 10:48 AM 779 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" 
                                    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

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

1 follower(s)

Stats

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