diff --git a/addons/stock/models/stock_quant.py b/addons/stock/models/stock_quant.py index 870c55887de..9168c1d9e55 100644 --- a/addons/stock/models/stock_quant.py +++ b/addons/stock/models/stock_quant.py @@ -263,7 +263,9 @@ class StockQuant(models.Model): lot_id = self.env['stock.lot'].browse(vals.get('lot_id')) package_id = self.env['stock.quant.package'].browse(vals.get('package_id')) owner_id = self.env['res.partner'].browse(vals.get('owner_id')) - quant = self._gather(product, location, lot_id=lot_id, package_id=package_id, owner_id=owner_id, strict=True) + if not self.env.context.get('import_file'): + # Merge quants later, to make sure one line = one record during batch import + quant = self._gather(product, location, lot_id=lot_id, package_id=package_id, owner_id=owner_id, strict=True) if lot_id: quant = quant.filtered(lambda q: q.lot_id) if quant: