<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="view_stock_move_line_operation_tree" model="ir.ui.view">
        <field name="name">product_expiry_simple.stock.move.line.tree</field>
        <field name="model">stock.move.line</field>
        <field name="inherit_id" ref="stock.view_stock_move_line_operation_tree" />
        <field name="arch" type="xml">
            <field name="lot_name" position="after">
                <field
                    name="expiry_date"
                    attrs="{'readonly': [('package_level_id', '!=', False), ('parent.picking_type_entire_packs', '=', True)]}"
                    invisible="not context.get('show_lots_text')"
                    groups="stock.group_production_lot"
                />
            </field>
        </field>
    </record>
    <record id="view_stock_move_line_detailed_operation_tree" model="ir.ui.view">
        <field name="name">product_expiry_simple.stock.move.line.tree</field>
        <field name="model">stock.move.line</field>
        <field
            name="inherit_id"
            ref="stock.view_stock_move_line_detailed_operation_tree"
        />
        <field name="arch" type="xml">
            <field name="lot_name" position="after">
                <field
                    name="expiry_date"
                    attrs="{'column_invisible': [('parent.show_lots_text', '=', False)], 'invisible': [('lots_visible', '=', False)]}"
                    groups="stock.group_production_lot"
                />
            </field>
        </field>
    </record>

</odoo>
