[Erp5-report] r35796 nicolas - /erp5/trunk/products/ERP5Type/XMLExportImport.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon May 31 17:03:38 CEST 2010


Author: nicolas
Date: Mon May 31 17:03:36 2010
New Revision: 35796

URL: http://svn.erp5.org?rev=35796&view=rev
Log:
detect None values in workflow

Modified:
    erp5/trunk/products/ERP5Type/XMLExportImport.py

Modified: erp5/trunk/products/ERP5Type/XMLExportImport.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/XMLExportImport.py?rev=35796&r1=35795&r2=35796&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/XMLExportImport.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/XMLExportImport.py [utf8] Mon May 31 17:03:36 2010
@@ -139,10 +139,13 @@
             variable_type = "date"
           if workflow_variable.find('language_revs') >= 0: # XXX specific to cps
             variable_type = "dict"
+          if workflow_action[workflow_variable] is None:
+            variable_type = 'None'
           variable_node = SubElement(workflow_node, workflow_variable,
                                      attrib=dict(type=variable_type))
-          variable_node_text = str(workflow_action[workflow_variable])
-          variable_node.text = unicode(variable_node_text, 'utf-8')
+          if variable_type != 'None':
+            variable_node_text = str(workflow_action[workflow_variable])
+            variable_node.text = unicode(variable_node_text, 'utf-8')
 
   # We should now describe security settings
   for user_role in self.get_local_roles():




More information about the Erp5-report mailing list