diff --git a/addons/mrp/models/stock_move.py b/addons/mrp/models/stock_move.py index f6fe94fc55b..170c69e1611 100644 --- a/addons/mrp/models/stock_move.py +++ b/addons/mrp/models/stock_move.py @@ -108,7 +108,7 @@ class StockMove(models.Model): store=True, help='Technical Field to order moves') needs_lots = fields.Boolean('Tracking', compute='_compute_needs_lots') - order_finished_lot_ids = fields.Many2many('stock.production.lot', compute='_compute_order_finished_lot_ids') + order_finished_lot_ids = fields.Many2many('stock.production.lot', string="Finished Lot/Serial Number", compute='_compute_order_finished_lot_ids') finished_lots_exist = fields.Boolean('Finished Lots Exist', compute='_compute_order_finished_lot_ids') should_consume_qty = fields.Float('Quantity To Consume', compute='_compute_should_consume_qty') @@ -123,7 +123,8 @@ class StockMove(models.Model): def _compute_order_finished_lot_ids(self): for move in self: if move.raw_material_production_id.move_finished_ids: - finished_lots_ids = move.raw_material_production_id.move_finished_ids.mapped('move_line_ids.lot_id').ids + # TODO ryv : to clean in master, finished_lots_exist is never used. order_finished_lot_ids can become one2many instead + finished_lots_ids = move.raw_material_production_id.lot_producing_id if finished_lots_ids: move.order_finished_lot_ids = finished_lots_ids move.finished_lots_exist = True diff --git a/addons/mrp/views/mrp_production_views.xml b/addons/mrp/views/mrp_production_views.xml index 16e04efdea9..ece07e2a67d 100644 --- a/addons/mrp/views/mrp_production_views.xml +++ b/addons/mrp/views/mrp_production_views.xml @@ -161,7 +161,7 @@ - +