[Erp5-report] r35541 yo - /erp5/trunk/products/ERP5/Document/Resource.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Sat May 22 02:40:36 CEST 2010
Author: yo
Date: Sat May 22 02:40:35 2010
New Revision: 35541
URL: http://svn.erp5.org?rev=35541&view=rev
Log:
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.
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=35541&r1=35540&r2=35541&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Resource.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Resource.py [utf8] Sat May 22 02:40:35 2010
@@ -660,7 +660,8 @@
security.declareProtected(Permissions.AccessContentsInformation,
'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.
"""
@@ -679,7 +680,12 @@
# Generate the predicate mapped value
# to get some price values.
domain_tool = getToolByName(self,'portal_domains')
- portal_type_list = self.getPortalSupplyPathTypeList()
+ if supply_path_type is None:
+ 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
tmp_context = self.asContext(context=context,
More information about the Erp5-report
mailing list