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

How to add a field inside a one2many list widget??

By
Alcaline
on 1/20/15, 10:33 PM 1,804 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>

@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).

Ivan
on 1/20/15, 11:09 PM

What exactly you want @alcaline?

Emipro Technologies Pvt. Ltd.
on 1/21/15, 2:37 AM

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

Umashankar Subramani
on 1/21/15, 2:42 AM

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: 1/20/15, 10:33 PM
Seen: 1804 times
Last updated: 3/16/15, 8:10 AM