Skip to Content
Menú
This question has been flagged
67 Vistes

Hello

I am trying to customize the search more popup window in the the stock move / picking to add description_pickin field there for a meaningful product list which i believe should be the default behavior.

This is the code I am using in my custom module but it is not working.



class ProductProduct(models.Model):
    _inherit = 'product.product'

    description_pickingin = fields.Text(
        string='Picking In Description',
        related='product_tmpl_id.description_pickingin',
        readonly=True,
    )



class StockPicking(models.Model):
    _inherit = 'stock.picking'

    description_pickingin = fields.Text(
        string='Picking In Description',
        related='move_ids.description_pickingin', # Assuming you use move_ids
        readonly=True,
    )





and the following in the view:

        <record id="stock_picking_tree_view_with_pickingin" model="ir.ui.view">
            <field name="name">stock.picking.tree.with.pickingin</field>
            <field name="model">stock.picking</field>
            <field name="inherit_id" ref="stock.view_picking_tree"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='name']" position="after">
                     <field name="description_pickingin" optional="show"/>
                </xpath>
            </field>
        </record>

        <record id="stock_move_tree_view_with_pickingin" model="ir.ui.view">
            <field name="name">stock.move.tree.with.pickingin</field>
            <field name="model">stock.move</field>
            <field name="inherit_id" ref="stock.view_move_tree"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='name']" position="after">
                    <field name="description_pickingin" optional="show"/>
                </xpath>
            </field>
        </record>


This code is not showing what i ned.


appreciate your help in advance.



Avatar
Descartar