diff --git a/mrp_restrict_lot/models/stock_rule.py b/mrp_restrict_lot/models/stock_rule.py index bd52446faca..54db408c097 100644 --- a/mrp_restrict_lot/models/stock_rule.py +++ b/mrp_restrict_lot/models/stock_rule.py @@ -35,7 +35,7 @@ def _prepare_mo_vals( lot = self.env["stock.lot"].browse(lot_id) mo_name = lot.name existing_mo = self.env["mrp.production"].search( - [("lot_producing_id", "=", lot_id)] + [("lot_producing_id", "=", lot_id), ("name", "=", mo_name)], limit=1 ) if existing_mo: mo_name = f"{mo_name}-{len(existing_mo)}"