diff --git a/product/ERP5/Document/Movement.py b/product/ERP5/Document/Movement.py
index 88c3ea553030bc974052cdb9a28dfef1e68f51c0..cd867cd3398d63421ce291751cb2f3fb4e4fbab3 100644
--- a/product/ERP5/Document/Movement.py
+++ b/product/ERP5/Document/Movement.py
@@ -853,13 +853,13 @@ class Movement(XMLObject, Amount, CompositionMixin):
     _setVariationCategoryList needs the resource to be set.
     """
     quantity = 0
-    if kw.has_key('source_debit') and kw.has_key('source_credit'):
+    if 'source_debit' in kw and 'source_credit' in kw:
       source_credit = kw.pop('source_credit') or 0
       source_debit = kw.pop('source_debit') or 0
       quantity += (source_credit - source_debit)
       kw['quantity'] = quantity
       kw['cancellation_amount'] = (source_credit < 0 or source_debit < 0)
-    if kw.has_key('destination_debit') and kw.has_key('destination_credit'):
+    if 'destination_debit' in kw and 'destination_credit' in kw:
       destination_credit = kw.pop('destination_credit') or 0
       destination_debit = kw.pop('destination_debit') or 0
       quantity += (destination_debit - destination_credit)