addons-cm/stock_picking_batch_collect/views/stock_picking_views.xml
GitHub Copilot 18cfd38347
Some checks failed
CI / lint (pull_request) Successful in 32s
CI / test (pull_request) Failing after 3m15s
CI / review (pull_request) Has been skipped
[IMP] stock_picking_batch_collect: demanded quantity on the move line lists
The move lists already show the demand, the move line ones do not: the
detailed operations of the batch and of the transfer, and the operator
(Basket Assembly) view. Adds a read-only column with the demand of the
line's move, in the unit of the line, next to the ordered quantity.

Closes #21

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

59 lines
3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_picking_form_inherit_collect" model="ir.ui.view">
<field name="name">stock.picking.form.collect</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='move_ids_without_package']/list/field[@name='product_uom_qty']" position="before">
<field name="sale_ordered_qty" readonly="1" optional="show"
column_invisible="parent.picking_type_code != 'outgoing'"/>
</xpath>
<xpath expr="//field[@name='move_ids_without_package']/list/field[@name='quantity']" position="after">
<field name="is_collected" widget="boolean_toggle" optional="show"
column_invisible="parent.state == 'draft'"
readonly="not move_line_ids or state in ('done', 'cancel')"/>
</xpath>
</field>
</record>
<record id="view_stock_move_line_detailed_operation_tree_inherit_collect" model="ir.ui.view">
<field name="name">stock.move.line.operations.list.collect</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">
<xpath expr="//field[@name='quantity']" position="before">
<field name="sale_ordered_qty" readonly="1" optional="show"
column_invisible="context.get('picking_code') == 'incoming'"/>
<field name="move_demand_qty" readonly="1" optional="show"/>
</xpath>
<xpath expr="//field[@name='quantity']" position="after">
<field name="is_collected" widget="boolean_toggle" optional="show"
readonly="state in ('done', 'cancel')"/>
</xpath>
</field>
</record>
<record id="view_stock_move_line_operation_tree_inherit_collect" model="ir.ui.view">
<field name="name">stock.move.line.operations.list.popup.collect</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">
<xpath expr="//field[@name='quantity']" position="after">
<field name="is_collected" widget="boolean_toggle"
readonly="state in ('done', 'cancel')"/>
</xpath>
</field>
</record>
<record id="view_picking_type_form_inherit_collect" model="ir.ui.view">
<field name="name">stock.picking.type.form.collect</field>
<field name="model">stock.picking.type</field>
<field name="inherit_id" ref="stock.view_picking_type_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='create_backorder']" position="after">
<field name="collected_check_required"/>
</xpath>
</field>
</record>
</odoo>