diff --git a/addons/stock/models/stock_quant.py b/addons/stock/models/stock_quant.py index 84e7b5596dd..ac1a814636d 100644 --- a/addons/stock/models/stock_quant.py +++ b/addons/stock/models/stock_quant.py @@ -917,7 +917,7 @@ class StockQuant(models.Model): self.product_id, self.location_id, lot_id=self.lot_id, package_id=self.package_id, owner_id=self.owner_id, strict=True) if quant: - self.quantity = quant.filtered(lambda q: q.lot_id == self.lot_id).quantity + self.quantity = sum(quant.filtered(lambda q: q.lot_id == self.lot_id).mapped('quantity')) # Special case: directly set the quantity to one for serial numbers, # it'll trigger `inventory_quantity` compute.