Commit daea76bb authored by Kevin Deldycke's avatar Kevin Deldycke

missing quantity value initialisation


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3186 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 78292bd5
...@@ -270,6 +270,7 @@ class Movement(XMLObject, Amount): ...@@ -270,6 +270,7 @@ class Movement(XMLObject, Amount):
""" """
result = self._baseGetSourceAssetPrice() result = self._baseGetSourceAssetPrice()
if result is not None: return result if result is not None: return result
quantity = self.getQuantity()
if quantity > 0.0: if quantity > 0.0:
return None return None
elif quantity < 0.0: elif quantity < 0.0:
...@@ -283,6 +284,7 @@ class Movement(XMLObject, Amount): ...@@ -283,6 +284,7 @@ class Movement(XMLObject, Amount):
""" """
result = self._baseGetDestinationAssetPrice() result = self._baseGetDestinationAssetPrice()
if result is not None: return result if result is not None: return result
quantity = self.getQuantity()
if quantity < 0.0: if quantity < 0.0:
return None return None
elif quantity > 0.0: elif quantity > 0.0:
...@@ -535,7 +537,6 @@ class Movement(XMLObject, Amount): ...@@ -535,7 +537,6 @@ class Movement(XMLObject, Amount):
""" """
return self.getDestinationSectionList() return self.getDestinationSectionList()
# Debit and credit methods # Debit and credit methods
security.declareProtected(Permissions.AccessContentsInformation, 'getSourceDebit') security.declareProtected(Permissions.AccessContentsInformation, 'getSourceDebit')
def getSourceDebit(self): def getSourceDebit(self):
...@@ -543,12 +544,10 @@ class Movement(XMLObject, Amount): ...@@ -543,12 +544,10 @@ class Movement(XMLObject, Amount):
Return the quantity Return the quantity
""" """
quantity = self.getQuantity() quantity = self.getQuantity()
try: try:
quantity = float(quantity) quantity = float(quantity)
except: except:
quantity = 0.0 quantity = 0.0
if quantity < 0: if quantity < 0:
return - quantity return - quantity
else: else:
...@@ -560,12 +559,10 @@ class Movement(XMLObject, Amount): ...@@ -560,12 +559,10 @@ class Movement(XMLObject, Amount):
Return the quantity Return the quantity
""" """
quantity = self.getQuantity() quantity = self.getQuantity()
try: try:
quantity = float(quantity) quantity = float(quantity)
except: except:
quantity = 0.0 quantity = 0.0
if quantity < 0: if quantity < 0:
return 0.0 return 0.0
else: else:
...@@ -617,7 +614,6 @@ class Movement(XMLObject, Amount): ...@@ -617,7 +614,6 @@ class Movement(XMLObject, Amount):
""" """
return return
# Item Access (tracking) # Item Access (tracking)
security.declareProtected(Permissions.AccessContentsInformation, 'getTrackedItemUidList') security.declareProtected(Permissions.AccessContentsInformation, 'getTrackedItemUidList')
def getTrackedItemUidList(self): def getTrackedItemUidList(self):
...@@ -627,7 +623,6 @@ class Movement(XMLObject, Amount): ...@@ -627,7 +623,6 @@ class Movement(XMLObject, Amount):
### XXX We should filter by portal type here ### XXX We should filter by portal type here
return self.getAggregateUidList() return self.getAggregateUidList()
# SKU vs. CU # SKU vs. CU
# security.declareProtected(Permissions.AccessContentsInformation, 'getSourceStandardInventoriatedQuantity') # security.declareProtected(Permissions.AccessContentsInformation, 'getSourceStandardInventoriatedQuantity')
# def getSourceStandardInventoriatedQuantity(self): # def getSourceStandardInventoriatedQuantity(self):
...@@ -640,7 +635,7 @@ class Movement(XMLObject, Amount): ...@@ -640,7 +635,7 @@ class Movement(XMLObject, Amount):
# For accounting, returns the quantity converted in a default unit # For accounting, returns the quantity converted in a default unit
# """ # """
# return self.getStandardInventoriatedQuantity() # return self.getStandardInventoriatedQuantity()
#
# security.declareProtected(Permissions.AccessContentsInformation, 'getDestinationStandardInventoriatedQuantity') # security.declareProtected(Permissions.AccessContentsInformation, 'getDestinationStandardInventoriatedQuantity')
# def getDestinationStandardInventoriatedQuantity(self): # def getDestinationStandardInventoriatedQuantity(self):
# """ # """
...@@ -652,5 +647,3 @@ class Movement(XMLObject, Amount): ...@@ -652,5 +647,3 @@ class Movement(XMLObject, Amount):
# For accounting, returns the quantity converted in a default unit # For accounting, returns the quantity converted in a default unit
# """ # """
# return self.getStandardInventoriatedQuantity() # return self.getStandardInventoriatedQuantity()
\ No newline at end of file
#
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