<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="view_stock_picking_batch_summary_line_tree" model="ir.ui.view">
        <field name="name">stock.picking.batch.summary.line.tree</field>
        <field name="model">stock.picking.batch.summary.line</field>
        <field name="arch" type="xml">
            <list create="0" delete="0" default_order="product_categ_id,product_id">
                <!-- Mostrar categoría a la izquierda del producto para mejor legibilidad -->
                <field name="product_categ_id" readonly="1"/>
                <field name="product_id" readonly="1"/>
                <!-- Unidad de medida opcional (oculta por defecto si el usuario lo decide) -->
                <field name="product_uom_id" readonly="1" optional="hide"/>
                <field name="qty_demanded" readonly="1"/>
                <field name="qty_done" readonly="1"/>
                <field name="qty_pending" readonly="1"/>
                <field name="is_collected" widget="boolean_toggle" nolabel="1"/>
            </list>
        </field>
    </record>

    <record id="view_stock_picking_batch_form_inherit_summary" model="ir.ui.view">
        <field name="name">stock.picking.batch.form.summary</field>
        <field name="model">stock.picking.batch</field>
        <field name="inherit_id" ref="stock_picking_batch.stock_picking_batch_form"/>
        <field name="arch" type="xml">
            <xpath expr="//notebook/page[@name='page_detailed_operations']" position="after">
                <page string="Product Summary" name="page_product_summary">
                    <field name="summary_line_ids" context="{'tree_view_ref': 'stock_picking_batch_custom.view_stock_picking_batch_summary_line_tree'}"/>
                </page>
            </xpath>
        </field>
    </record>

    <record id="view_stock_picking_batch_picking_tree_consumer_group" model="ir.ui.view">
        <field name="name">stock.picking.batch.picking.tree.consumer.group</field>
        <field name="model">stock.picking</field>
        <field name="inherit_id" ref="stock_picking_batch.stock_picking_view_batch_tree_ref"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='partner_id']" position="after">
                <field name="batch_consumer_group_id" optional="show"/>
            </xpath>
        </field>
    </record>

    <!-- assets: moved to manifest 'assets' declaration -->
</odoo>
