<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2021 ForgeFlow S.L.
     License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
    <record id="view_stock_move_line_operation_tree" model="ir.ui.view">
        <field
            name="name"
        >stock.move.line.operations.tree - stock_receipt_lot_info</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="lot_use_date"
                    groups="stock.group_production_lot"
                    optional="hide"
                    attrs="{'readonly': [('package_level_id', '!=', False), ('parent.picking_type_entire_packs', '=', True)]}"
                    invisible="not context.get('show_lots_text')"
                />
                <field
                    name="lot_removal_date"
                    groups="stock.group_production_lot"
                    optional="hide"
                    attrs="{'readonly': [('package_level_id', '!=', False), ('parent.picking_type_entire_packs', '=', True)]}"
                    invisible="not context.get('show_lots_text')"
                />
                <field
                    name="lot_alert_date"
                    groups="stock.group_production_lot"
                    optional="hide"
                    attrs="{'readonly': [('package_level_id', '!=', False), ('parent.picking_type_entire_packs', '=', True)]}"
                    invisible="not context.get('show_lots_text')"
                />
            </field>
        </field>
    </record>
    <record id="view_stock_move_line_detailed_operation_tree" model="ir.ui.view">
        <field
            name="name"
        >stock.move.line.operations.tree - stock_receipt_lot_info</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="lot_use_date"
                    optional="hide"
                    groups="stock.group_production_lot"
                    attrs="{'column_invisible': [('parent.show_lots_text', '=', False)], 'invisible': [('lots_visible', '=', False)]}"
                    context="{'default_product_id': product_id}"
                />
                <field
                    name="lot_removal_date"
                    optional="hide"
                    groups="stock.group_production_lot"
                    attrs="{'column_invisible': [('parent.show_lots_text', '=', False)], 'invisible': [('lots_visible', '=', False)]}"
                    context="{'default_product_id': product_id}"
                />
                <field
                    name="lot_alert_date"
                    optional="hide"
                    groups="stock.group_production_lot"
                    attrs="{'column_invisible': [('parent.show_lots_text', '=', False)], 'invisible': [('lots_visible', '=', False)]}"
                    context="{'default_product_id': product_id}"
                />
            </field>
        </field>
    </record>
</odoo>
