[IMP] stock_picking_batch_custom: add full-screen operator view for batch picking

Add a "Vista Operarios" button in the batch form header (visible when
in_progress) that opens a full-screen list of stock.move.line filtered
by the current batch. The view shows only the fields operators need
(category, product, partner, home_delivery, consumer_group, collected,
quantity) with larger rows and touch-friendly quantity input via CSS.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
GitHub Copilot 2026-05-29 18:30:46 +02:00
parent c8e0461120
commit a9a14e7db5
3 changed files with 76 additions and 0 deletions

View file

@ -221,6 +221,28 @@ class StockPickingBatch(models.Model):
product_names,
)
def action_open_operator_view(self):
self.ensure_one()
return {
"type": "ir.actions.act_window",
"name": self.name,
"res_model": "stock.move.line",
"view_mode": "list",
"views": [
(
self.env.ref(
"stock_picking_batch_custom.view_move_line_batch_operator"
).id,
"list",
)
],
"domain": [("batch_id", "=", self.id)],
"context": {
"create": False,
"delete": False,
},
}
class StockPickingBatchSummaryLine(models.Model):
_name = "stock.picking.batch.summary.line"

View file

@ -18,3 +18,30 @@ table.o_batch_move_line_list td[name="quantity"] .o_field_widget input {
min-height: 44px;
font-size: 1.1rem;
}
/* ── Operator view: full-screen, touch-optimised list ── */
table.o_batch_operator_list tbody tr.o_data_row td {
padding-top: 10px;
padding-bottom: 10px;
font-size: 1.05rem;
}
table.o_batch_operator_list th[data-name="quantity"],
table.o_batch_operator_list td[name="quantity"] {
min-width: 130px;
}
table.o_batch_operator_list td[name="quantity"] .o_field_widget input {
min-height: 48px;
font-size: 1.2rem;
text-align: center;
}
table.o_batch_operator_list td[name="is_collected"] {
min-width: 80px;
text-align: center;
}
table.o_batch_operator_list td[name="is_collected"] .o_field_widget {
transform: scale(1.4);
}

View file

@ -17,11 +17,38 @@
</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="0" 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="picking_partner_id" readonly="1" optional="show"/>
<field name="home_delivery" readonly="1" widget="boolean_toggle" optional="show"/>
<field name="consumer_group_id" readonly="1" optional="show"/>
<field name="is_collected" widget="boolean_toggle"/>
<field name="quantity" string="Cant."/>
</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="Vista Operarios"
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_custom.view_stock_picking_batch_summary_line_tree'}"/>