diff --git a/product/ERP5/Document/InventoryLine.py b/product/ERP5/Document/InventoryLine.py
index 1cba90bfcb4a2e5501d2093ef6e5f83f9f87281a..61223b820426bb0d39e74dece7cefb5988a7add2 100755
--- a/product/ERP5/Document/InventoryLine.py
+++ b/product/ERP5/Document/InventoryLine.py
@@ -88,8 +88,17 @@ class InventoryLine(DeliveryLine):
         return self.getInventory()
       else:
         # Use MySQL
-        aggregate = self.InventoryLine_zGetTotal()[0]
-        return aggregate.total_inventory or 0.0
+        # There is no inventory column in mysql any more,
+        # is it required to add it again. It is only
+        # usefull for the user interface
+        # aggregate = self.InventoryLine_zGetTotal()[0]
+        # return aggregate.total_inventory or 0.0
+
+        total_quantity = 0.0
+        for cell in self.getCellValueList(base_id='movement'):
+          if cell.getInventory() is not None:
+            total_quantity += cell.getInventory()
+        return total_quantity
 
     security.declareProtected(Permissions.AccessContentsInformation, 'getQuantity')
     def getQuantity(self):