Commit eade8e70 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Add support of passing supply path types explicitly to getPriceParameterDict....

Add support of passing supply path types explicitly to getPriceParameterDict. This is useful to filter out, for example, Purchase Supply Paths when the context is a Sale Order.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35541 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 72a60f52
...@@ -660,7 +660,8 @@ class Resource(XMLMatrix, Variated): ...@@ -660,7 +660,8 @@ class Resource(XMLMatrix, Variated):
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,
supply_path_type=None, **kw):
""" """
Get all pricing parameters from Predicate. Get all pricing parameters from Predicate.
""" """
...@@ -679,7 +680,12 @@ class Resource(XMLMatrix, Variated): ...@@ -679,7 +680,12 @@ class Resource(XMLMatrix, Variated):
# Generate the predicate mapped value # Generate the predicate mapped value
# to get some price values. # to get some price values.
domain_tool = getToolByName(self,'portal_domains') domain_tool = getToolByName(self,'portal_domains')
if supply_path_type is None:
portal_type_list = self.getPortalSupplyPathTypeList() portal_type_list = self.getPortalSupplyPathTypeList()
elif isinstance(supply_path_type, (list, tuple)):
portal_type_list = supply_path_type
else:
portal_type_list = (supply_path_type,)
# Generate the fake context # Generate the fake context
tmp_context = self.asContext(context=context, tmp_context = self.asContext(context=context,
......
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