From 95471930837a12eaed7c8fd9949a2b254dcecb66 Mon Sep 17 00:00:00 2001 From: GitHub Copilot Date: Thu, 21 May 2026 16:44:54 +0200 Subject: [PATCH] [IMP] stock_picking_batch_custom: show product code as separate optional column Add product_default_code related field to stock.move.line and stock.picking.batch.summary.line. Show it as a hidden-by-default column to the right of product_id in both detailed operations and product summary views. Hide the code prefix from the product name via display_default_code context so sorting is alphabetical. Co-Authored-By: Claude Sonnet 4.6 --- stock_picking_batch_custom/models/stock_move_line.py | 6 ++++++ .../models/stock_picking_batch.py | 5 +++++ .../views/stock_picking_batch_views.xml | 11 ++++++++--- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/stock_picking_batch_custom/models/stock_move_line.py b/stock_picking_batch_custom/models/stock_move_line.py index 1336eaa..b3c8861 100644 --- a/stock_picking_batch_custom/models/stock_move_line.py +++ b/stock_picking_batch_custom/models/stock_move_line.py @@ -17,6 +17,12 @@ class StockMoveLine(models.Model): readonly=True, ) + product_default_code = fields.Char( + string="Product Code", + related="product_id.default_code", + readonly=True, + ) + is_collected = fields.Boolean( string="Collected", default=False, diff --git a/stock_picking_batch_custom/models/stock_picking_batch.py b/stock_picking_batch_custom/models/stock_picking_batch.py index a8c274b..4e75122 100644 --- a/stock_picking_batch_custom/models/stock_picking_batch.py +++ b/stock_picking_batch_custom/models/stock_picking_batch.py @@ -253,6 +253,11 @@ class StockPickingBatchSummaryLine(models.Model): store=True, readonly=True, ) + product_default_code = fields.Char( + string="Product Code", + related="product_id.default_code", + readonly=True, + ) product_uom_id = fields.Many2one( comodel_name="uom.uom", string="Unit of Measure", diff --git a/stock_picking_batch_custom/views/stock_picking_batch_views.xml b/stock_picking_batch_custom/views/stock_picking_batch_views.xml index f4b868b..7c643db 100644 --- a/stock_picking_batch_custom/views/stock_picking_batch_views.xml +++ b/stock_picking_batch_custom/views/stock_picking_batch_views.xml @@ -5,10 +5,9 @@ stock.picking.batch.summary.line - - - + + @@ -50,6 +49,12 @@ + + {'display_default_code': False} + + + + hide