diff --git a/product/ERP5/Document/Movement.py b/product/ERP5/Document/Movement.py
index b5a62e5829e3c3c38b6846b971100c939519c5f2..a99cd137fb009a29541a73ec87361afefa913283 100644
--- a/product/ERP5/Document/Movement.py
+++ b/product/ERP5/Document/Movement.py
@@ -761,7 +761,8 @@ class Movement(XMLObject, Amount):
     """
     quantity = 0
     if kw.has_key('source_debit') and kw.has_key('source_credit'):
-      quantity += (kw.pop('source_credit') or 0 - kw.pop('source_debit') or 0)
+      quantity += ((kw.pop('source_credit') or 0) -
+                      (kw.pop('source_debit') or 0))
       kw['quantity'] = quantity
     if kw.has_key('destination_debit') and kw.has_key('destination_credit'):
       quantity += (kw.pop('destination_debit') or 0 -