From 6fe45e648da5227967b789fc495750f008361bae Mon Sep 17 00:00:00 2001 From: JF Aubert Date: Mon, 18 Dec 2023 10:13:35 +0100 Subject: [PATCH] [FIX] mrp: fix byproduct list view The stock.move.line view for byproducts displays the quant_id (Pick From). It is more appropriate to display the destination location (Store To). closes odoo/odoo#146604 Signed-off-by: William Henrotin (whe) --- addons/mrp/models/stock_move.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/mrp/models/stock_move.py b/addons/mrp/models/stock_move.py index 09f5e35bea4..5f7c50a9b94 100644 --- a/addons/mrp/models/stock_move.py +++ b/addons/mrp/models/stock_move.py @@ -218,6 +218,11 @@ class StockMove(models.Model): continue move.should_consume_qty = float_round((mo.qty_producing - mo.qty_produced) * move.unit_factor, precision_rounding=move.product_uom.rounding) + @api.depends('byproduct_id') + def _compute_show_info(self): + super()._compute_show_info() + self.filtered(lambda m: m.byproduct_id or m in self.production_id.move_finished_ids).show_quant = False + @api.onchange('product_uom_qty') def _onchange_product_uom_qty(self): if self.raw_material_production_id and self.has_tracking == 'none':