[Erp5-report] r36789 nicolas.dumazet - /erp5/trunk/products/ERP5/Document/Movement.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jul 2 04:28:28 CEST 2010


Author: nicolas.dumazet
Date: Fri Jul  2 04:28:26 2010
New Revision: 36789

URL: http://svn.erp5.org?rev=36789&view=rev
Log:
use xors

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=36789&r1=36788&r2=36789&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Movement.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Movement.py [utf8] Fri Jul  2 04:28:26 2010
@@ -385,9 +385,7 @@ class Movement(XMLObject, Amount, Compos
     """
     result = self.getSourceInventoriatedTotalAssetPrice()
     if result is not None :
-      if result > 0 and not self.isCancellationAmount():
-        return result
-      if result < 0 and self.isCancellationAmount():
+      if (result > 0) ^ bool(self.isCancellationAmount()):
         return result
     return 0.0
 
@@ -399,9 +397,7 @@ class Movement(XMLObject, Amount, Compos
     """
     result = self.getSourceInventoriatedTotalAssetPrice()
     if result is not None :
-      if result < 0 and not self.isCancellationAmount():
-        return -result
-      if result > 0 and self.isCancellationAmount():
+      if (result < 0) ^ bool(self.isCancellationAmount()):
         return -result
     return 0.0
 




More information about the Erp5-report mailing list