Skip to content
Snippets Groups Projects
Commit 85132f68 authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] mrp: warning for lot

The constraint should only check for move lots with a lot number already
filled in. Indeed, in case we use work orders, we can potentially create
move lots without S/N, and fill in the S/N later.

opw-727679
parent c6b4154f
Branches
Tags
No related merge requests found
......@@ -33,7 +33,7 @@ class StockMoveLots(models.Model):
def _check_lot_id(self):
if self.move_id.product_id.tracking == 'serial':
lots = set([])
for move_lot in self.move_id.move_lot_ids.filtered(lambda r: not r.lot_produced_id):
for move_lot in self.move_id.move_lot_ids.filtered(lambda r: not r.lot_produced_id and r.lot_id):
if move_lot.lot_id in lots:
raise exceptions.UserError(_('You cannot use the same serial number in two different lines.'))
if float_compare(move_lot.quantity_done, 1.0, precision_rounding=move_lot.product_id.uom_id.rounding) == 1:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment