Commit 4ea08fde authored by Yoshinori Okuji's avatar Yoshinori Okuji

No reason to make pricing methods to be private. So remove the underscore.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14898 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 681ddd96
...@@ -557,8 +557,8 @@ class Resource(XMLMatrix, Variated): ...@@ -557,8 +557,8 @@ class Resource(XMLMatrix, Variated):
return 1 # a has no destination ans loses return 1 # a has no destination ans loses
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'_getPriceParameterDict') 'getPriceParameterDict')
def _getPriceParameterDict(self, context=None, REQUEST=None, **kw): def getPriceParameterDict(self, context=None, REQUEST=None, **kw):
""" """
Get all pricing parameters from Predicate. Get all pricing parameters from Predicate.
""" """
...@@ -620,8 +620,8 @@ class Resource(XMLMatrix, Variated): ...@@ -620,8 +620,8 @@ class Resource(XMLMatrix, Variated):
return price_parameter_dict return price_parameter_dict
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'_getPricingVariable') 'getPricingVariable')
def _getPricingVariable(self, context=None): def getPricingVariable(self, context=None):
""" """
Return the value of the property used to calculate variable pricing Return the value of the property used to calculate variable pricing
This basically calls a script like Product_getPricingVariable This basically calls a script like Product_getPricingVariable
...@@ -652,7 +652,7 @@ class Resource(XMLMatrix, Variated): ...@@ -652,7 +652,7 @@ class Resource(XMLMatrix, Variated):
context = default context = default
default = None default = None
price_parameter_dict = self._getPriceParameterDict( price_parameter_dict = self.getPriceParameterDict(
context=context, REQUEST=REQUEST, **kw) context=context, REQUEST=REQUEST, **kw)
# Calculate the unit price # Calculate the unit price
unit_base_price = None unit_base_price = None
...@@ -684,7 +684,7 @@ class Resource(XMLMatrix, Variated): ...@@ -684,7 +684,7 @@ class Resource(XMLMatrix, Variated):
for additional_price in price_parameter_dict['additional_price']: for additional_price in price_parameter_dict['additional_price']:
unit_base_price += additional_price unit_base_price += additional_price
# Sum variable additional price # Sum variable additional price
variable_value = self._getPricingVariable(context=context) variable_value = self.getPricingVariable(context=context)
for variable_additional_price in \ for variable_additional_price in \
price_parameter_dict['variable_additional_price']: price_parameter_dict['variable_additional_price']:
unit_base_price += variable_additional_price * variable_value unit_base_price += variable_additional_price * variable_value
...@@ -727,6 +727,3 @@ class Resource(XMLMatrix, Variated): ...@@ -727,6 +727,3 @@ class Resource(XMLMatrix, Variated):
except TypeError: except TypeError:
return 0 return 0
return 0 return 0
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