Skip to Content
Menu
This question has been flagged
3 Replies
3354 Views

I'm trying extend inventory detailed operation with 1 more field.


To do this in Operations I can just create a record 

<data>
    <record id="extendet_inventory" model="ir.ui.view">
        <field name="name">Inventory</field>
        <field name="model">stock.picking</field>
        <field name="inherit_id" ref="stock.view_picking_form"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='move_ids_without_package']/tree/field[@name='product_id']" position="before">
                <field name="unit_name"/>
            </xpath>
        </field>
    </record>
</data>


But when I changing
expr="//field[@name='move_ids_without_package']

to

expr="//field[@name='move_line_ids_without_package']

and want work with Detailed operations Odoo shows error:

Element '<xpath expr="//field[@name='move_line_ids_without_package']/tree/field[@name='product_id']">' cannot be located in parent viewElement '<xpath expr="//field[@name='move_line_ids_without_package']/tree/field[@name='product_id']">' cannot be located in parent view

How can I write correct path to add 1 more field to this tree?


Avatar
Discard
Author Best Answer

I figured out it by my self. In case somebody would be looking for this issue:


path to insert into move_line_ids_without_package:

<field name="inherit_id" ref="stock.view_stock_move_line_detailed_operation_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_id']" position="before">
<field name="YOUR_EXTENED_FIELD" />
</xpath>
</field>


and you have to inherit model from:

_inherit = 'stock.move.line'



Avatar
Discard
Best Answer

Hello kirill,

Please change xpath:

<xpath expr="//notebook/page/field[@name='move_ids_without_package']/tree/field[@name='product_id']" position="before"> 

Regards,




Email:   odoo@aktivsoftware.com

Skype: kalpeshmaheshwari

   

Avatar
Discard