Commit bd6c671c authored by Sebastien Robin's avatar Sebastien Robin

if there is no mapped value, we have to take the default base price defined on...

if there is no mapped value, we have to take the default base price defined on the resource, it was not working


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4225 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fa8d3959
...@@ -523,12 +523,13 @@ class Resource(XMLMatrix, CoreResource, Variated): ...@@ -523,12 +523,13 @@ class Resource(XMLMatrix, CoreResource, Variated):
has_cell_content=0, **kw) has_cell_content=0, **kw)
# Calculate the unit price # Calculate the unit price
unit_base_price = None unit_base_price = None
base_price = None
if mapped_value is not None: if mapped_value is not None:
base_price = mapped_value.getBasePrice() base_price = mapped_value.getBasePrice()
if base_price in [None, '']: if base_price in [None, '']:
base_price = self.getBasePrice() base_price = self.getBasePrice()
if base_price not in [None, '']: if base_price not in [None, '']:
priced_quantity = self.getPricedQuantity() priced_quantity = self.getPricedQuantity()
unit_base_price = base_price / priced_quantity unit_base_price = base_price / priced_quantity
# Return result # Return result
return unit_base_price return unit_base_price
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