From 94e1a114edb5b0c43b746009a8a0476950bebeca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Fri, 24 Feb 2006 20:13:38 +0000 Subject: [PATCH] Make sure asset calculation methods returns 0 rather than None git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5839 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/Movement.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/product/ERP5/Document/Movement.py b/product/ERP5/Document/Movement.py index a9087624e6..a34988cffd 100755 --- a/product/ERP5/Document/Movement.py +++ b/product/ERP5/Document/Movement.py @@ -311,10 +311,9 @@ class Movement(XMLObject, Amount): """ result = self.getSourceInventoriatedTotalAssetPrice() if result is not None : - if result < 0: - return 0.0 - else : + if result > 0: return result + return 0.0 security.declareProtected( Permissions.AccessContentsInformation, 'getSourceInventoriatedTotalAssetCredit') @@ -326,8 +325,7 @@ class Movement(XMLObject, Amount): if result is not None : if result < 0: return -result - else : - return 0.0 + return 0.0 security.declareProtected( Permissions.AccessContentsInformation, 'getDestinationInventoriatedTotalAssetPrice') @@ -357,10 +355,9 @@ class Movement(XMLObject, Amount): """ result = self.getDestinationInventoriatedTotalAssetPrice() if result is not None : - if result < 0: - return 0.0 - else : + if result > 0: return result + return 0.0 security.declareProtected( Permissions.AccessContentsInformation, 'getDestinationInventoriatedTotalAssetCredit') @@ -372,8 +369,7 @@ class Movement(XMLObject, Amount): if result is not None : if result < 0: return -result - else : - return 0.0 + return 0.0 security.declareProtected( Permissions.AccessContentsInformation, 'getSourceAssetPrice') -- 2.30.9