<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2024 Moduon Team S.L.
     License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) -->
<data>
    <record id="view_move_extra_tree" model="ir.ui.view">
        <field name="name">view.move.extra.tree</field>
        <field name="model">stock.move</field>
        <field name="inherit_id" ref="stock.view_move_tree" />
        <field name="arch" type="xml">
            <field name="product_packaging_id" position="after">
                <field name="is_initial_demand_editable" invisible="1" />
                <field
                    name="product_packaging_qty"
                    groups="product.group_stock_packaging"
                    attrs="{
                        'readonly': [
                            '|',
                            ('product_packaging_id', '=', False),
                            ('is_initial_demand_editable', '=', False),
                        ],
                    }"
                />
            </field>
        </field>
    </record>

    <record id="view_stock_move_operations" model="ir.ui.view">
        <field name="name">Add product packaging qty info</field>
        <field name="model">stock.move</field>
        <field name="inherit_id" ref="stock.view_stock_move_operations" />
        <field name="arch" type="xml">
            <xpath expr="//group" position="inside">
                <group
                    groups="product.group_stock_packaging"
                    name="packaging"
                    attrs="{'invisible': [('product_packaging_id', '=', False)]}"
                >
                    <label for="product_packaging_qty" string="Packagings demanded" />
                    <div class="o_row">
                        <span><field
                                name="product_packaging_qty"
                                readonly="1"
                                nolabel="1"
                            /></span>
                        <span><field
                                name="product_packaging_id"
                                readonly="1"
                                nolabel="1"
                            /></span>
                    </div>
                    <label for="product_packaging_qty_done" string="Packagings done" />
                    <div class="o_row">
                        <span><field
                                name="product_packaging_qty_done"
                                readonly="1"
                                nolabel="1"
                            /></span>
                        <span> / </span>
                        <span><field
                                name="product_packaging_qty"
                                readonly="1"
                                nolabel="1"
                            /></span>
                        <span><field
                                name="product_packaging_id"
                                readonly="1"
                                nolabel="1"
                            /></span>
                    </div>
                </group>
            </xpath>
        </field>
    </record>
</data>
