addons-cm/stock_picking_batch_collect/views/stock_picking_batch_views.xml
GitHub Copilot 9c81cb986d
[IMP] stock_picking_batch_collect: collected checks on transfers, ordered quantity, delivery slips report
- The collected checks also apply to transfers outside a batch, opt-in per
  operation type ("Require Collected Lines"), with the batch restrictions of
  the settings. A per-product toggle in the transfer's Operations tab collects
  all its lines.
- Read-only ordered quantity from the sale line on every batch and transfer
  view, since the weighed demand overwrites it. Adds a dependency on
  sale_stock; a migration fills it in the summary of open batches.
- "Delivery Slips" report on the batch: all its delivery slips in one PDF.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 14:34:06 +02:00

119 lines
6.4 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">
<field name="product_categ_id" readonly="1"/>
<field name="product_id" readonly="1" context="{'display_default_code': False}"/>
<field name="product_default_code" readonly="1" optional="hide"/>
<field name="product_uom_id" readonly="1" optional="hide"/>
<field name="qty_ordered" readonly="1" optional="show"/>
<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_move_line_batch_operator" model="ir.ui.view">
<field name="name">stock.move.line.batch.operator</field>
<field name="model">stock.move.line</field>
<field name="arch" type="xml">
<list create="0" delete="1" editable="bottom"
default_order="product_categ_id,product_id,picking_partner_id"
class="o_batch_operator_list">
<field name="batch_id" column_invisible="True"/>
<field name="product_categ_id" readonly="1" optional="show"/>
<field name="product_id" readonly="1"
context="{'display_default_code': False}"/>
<field name="reference" readonly="1" optional="hide"/>
<field name="picking_partner_id" readonly="1" optional="show"/>
<field name="sale_ordered_qty" string="Ordered" readonly="1" optional="show"/>
<field name="quantity" string="Cant."/>
<!-- Loaded so `_onchange_quantity_manual` reaches the server. -->
<field name="picked" column_invisible="True"/>
<field name="is_collected" widget="boolean_toggle"/>
</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="//button[@name='action_done']" position="before">
<button name="action_open_operator_view"
string="Basket Assembly"
type="object"
class="btn-secondary"
invisible="state != 'in_progress'"/>
</xpath>
<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_collect.view_stock_picking_batch_summary_line_tree'}"/>
</page>
</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="//list" position="attributes">
<attribute name="default_order">product_categ_id,product_id,picking_partner_id</attribute>
<attribute name="class">o_batch_move_line_list</attribute>
</xpath>
<xpath expr="//field[@name='product_id']" position="before">
<field name="product_categ_id" readonly="1"/>
</xpath>
<xpath expr="//field[@name='product_id']" position="attributes">
<attribute name="context">{'display_default_code': False}</attribute>
</xpath>
<xpath expr="//field[@name='product_id']" position="after">
<field name="picking_partner_id" readonly="1" optional="show"/>
<field name="product_default_code" readonly="1" optional="hide"/>
<field name="is_collected" widget="boolean_toggle" optional="show"/>
</xpath>
<xpath expr="//field[@name='quantity']" position="before">
<field name="sale_ordered_qty" readonly="1" optional="show"/>
</xpath>
<xpath expr="//field[@name='quantity']" position="after">
<!-- Loaded so `_onchange_quantity_manual` reaches the server. -->
<field name="picked" column_invisible="True"/>
</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>
<xpath expr="//field[@name='picking_id']" position="attributes">
<attribute name="optional">hide</attribute>
</xpath>
<xpath expr="//field[@name='location_id']" position="attributes">
<attribute name="optional">hide</attribute>
</xpath>
<xpath expr="//field[@name='location_dest_id']" position="attributes">
<attribute name="optional">hide</attribute>
</xpath>
</field>
</record>
<record id="view_picking_move_tree_inherit_batch_collect" model="ir.ui.view">
<field name="name">stock_picking_batch.picking.move.list.collect</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock_picking_batch.view_picking_move_tree_inherited"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_uom_qty']" position="before">
<field name="sale_ordered_qty" readonly="1" optional="show"/>
</xpath>
</field>
</record>
</odoo>