Commit 0b87bb47 authored by Sebastien Robin's avatar Sebastien Robin

do not put in the list resource with empty quantities


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3096 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 85598a7b
...@@ -313,7 +313,7 @@ class TransformedResource(XMLObject, XMLMatrix, Amount): ...@@ -313,7 +313,7 @@ class TransformedResource(XMLObject, XMLMatrix, Amount):
# We'd better have better API for this, like an update function in the mapped_value # We'd better have better API for this, like an update function in the mapped_value
try: try:
quantity = float(quantity) quantity = float(quantity)
except: except ValueError:
error_string += 'Quantity is not a float.' error_string += 'Quantity is not a float.'
...@@ -338,6 +338,9 @@ class TransformedResource(XMLObject, XMLMatrix, Amount): ...@@ -338,6 +338,9 @@ class TransformedResource(XMLObject, XMLMatrix, Amount):
variation_category_list_defined_by = mapped_value.getRelativeUrl() variation_category_list_defined_by = mapped_value.getRelativeUrl()
if variation_category_list in [None,'',[], ()]: if variation_category_list in [None,'',[], ()]:
if quantity == 0:
return aggregated_amount_list
else:
raise KeyError, "No cell variation matching on TransformedResource '%s' for current context" % ( self.getRelativeUrl() , ) raise KeyError, "No cell variation matching on TransformedResource '%s' for current context" % ( self.getRelativeUrl() , )
else: else:
......
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