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):
"""
result = self._baseGetSourceAssetPrice()
if result is not None: return result
quantity = self.getQuantity()
if quantity > 0.0:
return None
elif quantity < 0.0:
......@@ -283,6 +284,7 @@ class Movement(XMLObject, Amount):
"""
result = self._baseGetDestinationAssetPrice()
if result is not None: return result
quantity = self.getQuantity()
if quantity < 0.0:
return None
elif quantity > 0.0:
......@@ -535,7 +537,6 @@ class Movement(XMLObject, Amount):
"""
return self.getDestinationSectionList()
# Debit and credit methods
security.declareProtected(Permissions.AccessContentsInformation, 'getSourceDebit')
def getSourceDebit(self):
......@@ -543,12 +544,10 @@ class Movement(XMLObject, Amount):
Return the quantity
"""
quantity = self.getQuantity()
try:
quantity = float(quantity)
except:
quantity = 0.0
if quantity < 0:
return - quantity
else:
......@@ -560,12 +559,10 @@ class Movement(XMLObject, Amount):
Return the quantity
"""
quantity = self.getQuantity()
try:
quantity = float(quantity)
except:
quantity = 0.0
if quantity < 0:
return 0.0
else:
......@@ -617,7 +614,6 @@ class Movement(XMLObject, Amount):
"""
return
# Item Access (tracking)
security.declareProtected(Permissions.AccessContentsInformation, 'getTrackedItemUidList')
def getTrackedItemUidList(self):
......@@ -627,7 +623,6 @@ class Movement(XMLObject, Amount):
### XXX We should filter by portal type here
return self.getAggregateUidList()
# SKU vs. CU
# security.declareProtected(Permissions.AccessContentsInformation, 'getSourceStandardInventoriatedQuantity')
# def getSourceStandardInventoriatedQuantity(self):
......@@ -640,7 +635,7 @@ class Movement(XMLObject, Amount):
# For accounting, returns the quantity converted in a default unit
# """
# return self.getStandardInventoriatedQuantity()
#
# security.declareProtected(Permissions.AccessContentsInformation, 'getDestinationStandardInventoriatedQuantity')
# def getDestinationStandardInventoriatedQuantity(self):
# """
......@@ -652,5 +647,3 @@ class Movement(XMLObject, Amount):
# For accounting, returns the quantity converted in a default unit
# """
# 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