[Erp5-report] r39015 jerome - /erp5/trunk/products/ERP5/Document/Movement.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Oct 11 11:16:25 CEST 2010


Author: jerome
Date: Mon Oct 11 11:16:22 2010
New Revision: 39015

URL: http://svn.erp5.org?rev=39015&view=rev
Log:
use 'in' rather than dict.has_key

Modified:
    erp5/trunk/products/ERP5/Document/Movement.py

Modified: erp5/trunk/products/ERP5/Document/Movement.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Movement.py?rev=39015&r1=39014&r2=39015&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Movement.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Movement.py [utf8] Mon Oct 11 11:16:22 2010
@@ -853,13 +853,13 @@ class Movement(XMLObject, Amount, Compos
     _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)




More information about the Erp5-report mailing list