addons-cm/stock_picking_batch_custom/views/stock_picking_batch_views.xml
GitHub Copilot 4d5e0c5502 [IMP] stock_picking_batch_custom: show product category in detailed operations view
Add product_categ_id before product_id (visible by default) and hide
company and unit of measure fields by default in the detailed operations tab.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:22:57 +02:00

63 lines
3.2 KiB
XML

<?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>
<record id="view_move_line_tree_inherit_batch_custom" model="ir.ui.view">
<field name="name">stock.move.line.list.batch.custom</field>
<field name="model">stock.move.line</field>
<field name="inherit_id" ref="stock_picking_batch.view_move_line_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_id']" position="before">
<field name="product_categ_id" readonly="1"/>
</xpath>
<xpath expr="//field[@name='product_uom_id']" position="attributes">
<attribute name="optional">hide</attribute>
</xpath>
<xpath expr="//field[@name='company_id'][@groups='base.group_multi_company']" position="attributes">
<attribute name="optional">hide</attribute>
</xpath>
</field>
</record>
<!-- assets: moved to manifest 'assets' declaration -->
</odoo>