[Erp5-report] r28194 - /erp5/trunk/products/ERP5/Document/BusinessProcess.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jul 28 17:39:40 CEST 2009


Author: luke
Date: Tue Jul 28 17:39:39 2009
New Revision: 28194

URL: http://svn.erp5.org?rev=28194&view=rev
Log:
 - pass relative url to build method to be able to use it in activities
 - if no trade_phase is passed for getPathValueList return all paths
 - fix typo

Modified:
    erp5/trunk/products/ERP5/Document/BusinessProcess.py

Modified: erp5/trunk/products/ERP5/Document/BusinessProcess.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessProcess.py?rev=28194&r1=28193&r2=28194&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessProcess.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/BusinessProcess.py [utf8] Tue Jul 28 17:39:39 2009
@@ -71,7 +71,7 @@
 
   # Access to path and states of the business process
   security.declareProtected(Permissions.AccessContentsInformation, 'getPathValueList')
-  def getPathValueList(self, trade_phase, context=None, **kw):
+  def getPathValueList(self, trade_phase=None, context=None, **kw):
     """
       Returns all Path of the current BusinessProcess which
       are matching the given trade_phase and the optional context.
@@ -89,6 +89,8 @@
     if not isinstance(trade_phase, (list, tuple)):
       trade_phase = (trade_phase,)
     result = []
+    if len(trade_phase) == 0:
+      return self.contentValues(portal_type="Business Path")
     for document in self.contentValues(portal_type="Business Path"):
       for phase in trade_phase:
         if document.isMemberOf('trade_phase/' + phase): # XXX - not so good, use filter if possible
@@ -183,10 +185,11 @@
           result.append(state)
     return result
 
-  def build(self, explanation):
+  def build(self, explanation_relative_url):
     """
       Build whatever is buildable
     """
+    explanation = self.restrictedTraverse(explanation_relative_url)
     for path in self.getBuildablePathValueList(explanation):
       path.build(explanation)
 
@@ -221,7 +224,7 @@
     """
       Returns a list of head path(s) of this business process
 
-      trade_phase_list -- used to filterring, means that discovering
+      trade_phase_list -- used to filtering, means that discovering
                           a list of head path with the trade_phase_list
     """
     head_path_list = list()




More information about the Erp5-report mailing list