Commit f91ad7f9 authored by Nicolas Dumazet's avatar Nicolas Dumazet

those two tests could be one xor

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36788 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3c785ebb
No related merge requests found
......@@ -433,9 +433,7 @@ class Movement(XMLObject, Amount, CompositionMixin):
"""
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, CompositionMixin):
"""
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment