Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
6942 Prikazi

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.

Avatar
Opusti

share your xml and python code here

Avtor Best Answer

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>

Avatar
Opusti