diff --git a/addons/stock/models/stock_production_lot.py b/addons/stock/models/stock_production_lot.py index 5a7a72074aa..cbb074cb669 100644 --- a/addons/stock/models/stock_production_lot.py +++ b/addons/stock/models/stock_production_lot.py @@ -40,7 +40,7 @@ class ProductionLot(models.Model): @api.multi def write(self, vals): if 'product_id' in vals: - move_lines = self.env['stock.move.line'].search([('lot_id', 'in', self.ids)]) + move_lines = self.env['stock.move.line'].search([('lot_id', 'in', self.ids), ('product_id', '!=', vals['product_id'])]) if move_lines: raise UserError(_( 'You are not allowed to change the product linked to a serial or lot number ' +