[Erp5-report] r36788 nicolas.dumazet - /erp5/trunk/products/ERP5/Document/Movement.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Jul 2 04:19:22 CEST 2010
Author: nicolas.dumazet
Date: Fri Jul 2 04:19:19 2010
New Revision: 36788
URL: http://svn.erp5.org?rev=36788&view=rev
Log:
those two tests could be one xor
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=36788&r1=36787&r2=36788&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Movement.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Movement.py [utf8] Fri Jul 2 04:19:19 2010
@@ -433,9 +433,7 @@ class Movement(XMLObject, Amount, Compos
"""
result = self.getDestinationInventoriatedTotalAssetPrice()
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
@@ -447,9 +445,7 @@ class Movement(XMLObject, Amount, Compos
"""
result = self.getDestinationInventoriatedTotalAssetPrice()
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