[IMP] stock_picking_batch_custom: order detailed ops by category, product, partner

Store picking_partner_id on stock.move.line and set default_order to
product_categ_complete_name, product_id, picking_partner_id in the
detailed operations view so sorting uses the full category path
(e.g. 'SECO ENVASADO / Aperitivos') instead of only the leaf name.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
GitHub Copilot 2026-05-28 20:01:17 +02:00
parent 16941b8183
commit 8b9995526e
2 changed files with 8 additions and 1 deletions

View file

@ -17,6 +17,13 @@ class StockMoveLine(models.Model):
readonly=True,
)
product_categ_complete_name = fields.Char(
string="Product Category Path",
related="product_id.categ_id.complete_name",
store=True,
readonly=True,
)
product_default_code = fields.Char(
string="Product Code",
related="product_id.default_code",

View file

@ -47,7 +47,7 @@
<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="default_order">product_categ_complete_name,product_id,picking_partner_id</attribute>
<attribute name="class">o_batch_move_line_list</attribute>
</xpath>
<xpath expr="//field[@name='product_id']" position="before">