Commit a6abeda7 authored by Alexandre Boeglin's avatar Alexandre Boeglin

* _pricingSortMethod: Destination is acquired from parent on supplies, no need

  to do it manually.
* getPriceParameterDict: filtering on portal type is not the correct way,
  revert previous change.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19277 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f96e9016
......@@ -546,17 +546,13 @@ class Resource(XMLMatrix, Variated):
def _pricingSortMethod(self, a, b):
# Simple method : the one that defines a destination wins
parent = a.getParentValue()
if parent.getPortalType().endswith(' Line'):
parent = parent.getParentValue()
if parent.getDestination():
return -1 # a has a destination and wins
return 1 # a has no destination ans loses
if a.getDestination():
return -1 # a defines a destination and wins
return 1 # a defines no destination ans loses
security.declareProtected(Permissions.AccessContentsInformation,
'getPriceParameterDict')
def getPriceParameterDict(self, context=None, REQUEST=None,
portal_type_list=None, **kw):
def getPriceParameterDict(self, context=None, REQUEST=None, **kw):
"""
Get all pricing parameters from Predicate.
"""
......@@ -575,8 +571,7 @@ class Resource(XMLMatrix, Variated):
# Generate the predicate mapped value
# to get some price values.
domain_tool = getToolByName(self,'portal_domains')
if portal_type_list is None:
portal_type_list = self.getPortalSupplyPathTypeList()
portal_type_list = self.getPortalSupplyPathTypeList()
# Generate the fake 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