diff --git a/stock_picking_batch_custom/models/stock_move_line.py b/stock_picking_batch_custom/models/stock_move_line.py index 9d73b53..cbf9400 100644 --- a/stock_picking_batch_custom/models/stock_move_line.py +++ b/stock_picking_batch_custom/models/stock_move_line.py @@ -8,6 +8,7 @@ from odoo import models class StockMoveLine(models.Model): _inherit = "stock.move.line" + _order = "product_categ_complete_name, product_name, partner_name, id" product_categ_id = fields.Many2one( comodel_name="product.category", @@ -24,6 +25,20 @@ class StockMoveLine(models.Model): readonly=True, ) + product_name = fields.Char( + string="Product Name", + related="product_id.name", + store=True, + readonly=True, + ) + + partner_name = fields.Char( + string="Partner Name", + related="picking_id.partner_id.name", + store=True, + readonly=True, + ) + product_default_code = fields.Char( string="Product Code", related="product_id.default_code", 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 3282d5c..56e23e8 100644 --- a/stock_picking_batch_custom/views/stock_picking_batch_views.xml +++ b/stock_picking_batch_custom/views/stock_picking_batch_views.xml @@ -47,7 +47,7 @@ - product_categ_complete_name,product_id,picking_partner_id + product_categ_complete_name,product_name,partner_name o_batch_move_line_list