[Erp5-report] r19277 - /erp5/trunk/products/ERP5/Document/Resource.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Feb 12 17:12:21 CET 2008
Author: alex
Date: Tue Feb 12 17:12:21 2008
New Revision: 19277
URL: http://svn.erp5.org?rev=19277&view=rev
Log:
* _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.
Modified:
erp5/trunk/products/ERP5/Document/Resource.py
Modified: erp5/trunk/products/ERP5/Document/Resource.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Resource.py?rev=19277&r1=19276&r2=19277&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Resource.py (original)
+++ erp5/trunk/products/ERP5/Document/Resource.py Tue Feb 12 17:12:21 2008
@@ -546,17 +546,13 @@
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 @@
# 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,
More information about the Erp5-report
mailing list