[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.
This commit is contained in:
Josse Colpaert
2017-10-23 10:15:47 +02:00
committed by Nicolas Martinelli
parent e2532f855f
commit 0038bf43f2
+1 -1
View File
@@ -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.'))