[Erp5-report] r10151 - /erp5/trunk/products/ERP5/Document/BusinessTemplate.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Sep 19 14:00:59 CEST 2006


Author: alex
Date: Tue Sep 19 14:00:51 2006
New Revision: 10151

URL: http://svn.erp5.org?rev=10151&view=rev
Log:
allows importing templates when the catalog method filter does not use an
Expression

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

Modified: erp5/trunk/products/ERP5/Document/BusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessTemplate.py?rev=10151&r1=10150&r2=10151&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py Tue Sep 19 14:00:51 2006
@@ -1245,7 +1245,7 @@
           workflow_name = workflow[1:]
         else:
           workflow_name = workflow
-        if workflow[0]!= '-' and \
+        if workflow[0] != '-' and \
             workflow_name not in chain_dict['chain_%s' % portal_type]:
           raise NotFound, 'workflow %s not found in chain for portal_type %s'\
                 % (workflow, portal_type)
@@ -1815,7 +1815,10 @@
         key = method.getAttribute('key')
         key_type = str(method.getAttribute('type'))
         if key_type == "str":
-          value = str(method.getElementsByTagName('value')[0].childNodes[0].data)
+          if len(method.getElementsByTagName('value')[0].childNodes):
+            value = str(method.getElementsByTagName('value')[0].childNodes[0].data)
+          else:
+            value = ''
           key = str(key)
         elif key_type == "int":
           value = int(method.getElementsByTagName('value')[0].childNodes[0].data)




More information about the Erp5-report mailing list