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.

1

How to add a field in tree view of move_lines in stock.picking.in??

By
Miel
on 10/24/14, 3:00 AM 1,076 views

Does anyone here knows how to add a  field  in move_lines(one2many to stock.move) under stock.picking.in? I xpath stock.picking and stock.picking in but it does not display. Anyone Please help.

share your xml and python code here

Odoo
on 10/24/14, 3:11 AM
0
Miel
On 10/24/14, 3:25 AM

Here is my xml... stock.move already have price_unit and I want to display it in move_lines

<record id="view_move_picking_form2" model="ir.ui.view">
            <field name="name">stock.picking.form2</field>
            <field name="model">stock.picking</field>
            <field eval="100" name="priority" />
            <field name="inherit" ref="stock.view_picking_form" />
            <field name="arch" type="xml">
                <xpath expr="//page/field[@name='move_lines']" position="replace">
                    <field name="move_lines">
                        <tree string="Stock Moves">
                            <field name="product_id" />
                            <field name="product_qty"
                                on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"
                                sum="Amount" />
                            <field name="price_unit" />
                            <field name="product_uom" string="Unit of Measure" groups="product.group_uom" />
                            
                            <field name="date" />
                            <field name="prodlot_id" />
                            <field name="location_id" groups="stock.group_locations" />
                            <field name="location_dest_id" groups="stock.group_locations" />
                            <field name="state" />
                        </tree>
                    </field>

                </xpath>
            </field>
        </record>


        <record id="view_move_picking_in_form2" model="ir.ui.view">
            <field name="name">stock.picking.in.form2</field>
            <field name="model">stock.picking.in</field>
            <field eval="100" name="priority" />
            <field name="inherit" ref="stock.view_picking_in_form" />
            <field name="arch" type="xml">
                <xpath expr="//field[@name='move_lines']" position="replace">
                    <field name="move_lines">
                        <tree string="Stock Moves">
                            <field name="product_id" />
                            <field name="product_qty"
                                on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"
                                sum="Amount" />
                            <field name="product_uom" string="Unit of Measure" groups="product.group_uom" />
                            <field name="price_unit" />
                            <field name="date" />
                            <field name="prodlot_id" />
                            <field name="location_id" groups="stock.group_locations" />
                            <field name="location_dest_id" groups="stock.group_locations" />
                            <field name="state" />
                        </tree>
                    </field>

                </xpath>
            </field>
        </record>

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

2 follower(s)

Stats

Asked: 10/24/14, 3:00 AM
Seen: 1076 times
Last updated: 3/16/15, 8:10 AM