Skip to Content
Menu
This question has been flagged
1 Reply
13181 Views

I want to add a field inside a one2many list...

 

<record model="ir.ui.view" id="biz1_view_sale_stock_form">
            <field name="name">biz1.sale.stock.form</field>
            <field name="model">sale.order</field>
            <field name="inherit_id" ref="sale.view_order_form" />
            <field eval="1" name="priority" />
            <field name="arch" type="xml">
            
                <xpath expr="//notebook/page[@string='Order Lines']" position="after">
                    <page string="Delivery Orders">
                        <field name="picking_idss" readonly="True" widget="one2many_list">
                        </field>
                    </page>
                </xpath>
                <xpath expr="//notebook/page/field[@name='order_line']/tree" position="replace">
                 <tree string="Sales Order Lines" editable="bottom">
                                    <field name="sequence" widget="handle"/>
                                    <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, product_uom, product_uos_qty, product_uos, name, parent.partner_id, False, True, parent.date_order, False, parent.fiscal_position, False, context)"/>
                                    <field name="name"/>
                                    <field name="product_uom_qty"
                                        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, product_uom, product_uos_qty, product_uos, name, parent.partner_id, False, False, parent.date_order, False, parent.fiscal_position, True, context)"
                                        sum = "Total Quantity"/>
                                    <field name="product_uom"
                                        on_change="product_uom_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, product_uos_qty, product_uos, name, parent.partner_id, False, False, parent.date_order, context)"
                                        groups="product.group_uom" options='{"no_open": True}'/>
                                    <field name="product_uos_qty" groups="product.group_uos" invisible="1"/>
                                    <field name="product_uos" string="UoS" groups="product.group_uos" invisible="1"/>
                                    <field name="tax_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
                                    <field name="price_unit"/>
                                    <field name="discount" groups="sale.group_discount_per_so_line"/>
                                    <field name="price_subtotal"/>
                                </tree>
              </xpath>                  
            </field>
        </record>

Avatar
Discard

@Alcaline, can you elaborate what problem are you facing? The XML snippet that you have pasted can do what you want (add a new field to one2many list).

What exactly you want @alcaline?

Do u got any error or ?......

Best Answer
"

 
           
             
            
       "

OR

if you want to display specific number of fields, you can list them by this way

"  
    
             

                    />                    /> />


    

"

Avatar
Discard