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): ...@@ -546,17 +546,13 @@ class Resource(XMLMatrix, Variated):
def _pricingSortMethod(self, a, b): def _pricingSortMethod(self, a, b):
# Simple method : the one that defines a destination wins # Simple method : the one that defines a destination wins
parent = a.getParentValue() if a.getDestination():
if parent.getPortalType().endswith(' Line'): return -1 # a defines a destination and wins
parent = parent.getParentValue() return 1 # a defines no destination ans loses
if parent.getDestination():
return -1 # a has a destination and wins
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, def getPriceParameterDict(self, context=None, REQUEST=None, **kw):
portal_type_list=None, **kw):
""" """
Get all pricing parameters from Predicate. Get all pricing parameters from Predicate.
""" """
...@@ -575,7 +571,6 @@ class Resource(XMLMatrix, Variated): ...@@ -575,7 +571,6 @@ 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 portal_type_list is None:
portal_type_list = self.getPortalSupplyPathTypeList() portal_type_list = self.getPortalSupplyPathTypeList()
# Generate the fake context # Generate the fake 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