From 0038bf43f23bbd19dd7156d649dd5aa4447cb6a4 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Mon, 16 Oct 2017 14:48:32 +0200 Subject: [PATCH] [FIX] mrp: avoid inactive move lots validation as a safety We try to avoid to take the inactive move lots. While they are normally already filtered through the split, we had a case when you update the quantity of the mo, that the split would not separate them. --- addons/mrp/models/stock_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/models/stock_move.py b/addons/mrp/models/stock_move.py index a87d6623dcc..183bd0dc1c6 100644 --- a/addons/mrp/models/stock_move.py +++ b/addons/mrp/models/stock_move.py @@ -284,7 +284,7 @@ class StockMove(models.Model): quants = quant_obj.quants_get_preferred_domain(move.product_qty, move, domain=main_domain, preferred_domain_list=preferred_domain_list) self.env['stock.quant'].quants_move(quants, move, move.location_dest_id) else: - for movelot in move.move_lot_ids: + for movelot in move.active_move_lot_ids: if float_compare(movelot.quantity_done, 0, precision_rounding=rounding) > 0: if not movelot.lot_id: raise UserError(_('You need to supply a lot/serial number.'))