[Erp5-report] r31525 fabien - /erp5/trunk/products/ERP5OOo/FormPrintout.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Dec 29 18:27:51 CET 2009


Author: fabien
Date: Tue Dec 29 18:27:51 2009
New Revision: 31525

URL: http://svn.erp5.org?rev=31525&view=rev
Log:
converting value to string make not possible to use list

In some cases, we may want to use lists (like in parallel list fields), so it's
not good to always value to string. If a conversion (with '\n' addition and
'\r' replacement) is needed, this should be done in the render_od* method

Modified:
    erp5/trunk/products/ERP5OOo/FormPrintout.py

Modified: erp5/trunk/products/ERP5OOo/FormPrintout.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/FormPrintout.py?rev=31525&r1=31524&r2=31525&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/FormPrintout.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/FormPrintout.py [utf8] Tue Dec 29 18:27:51 2009
@@ -1030,13 +1030,8 @@
       text_xpath = '//draw:frame[@draw:name="%s"]' % field.id
       node_list = element_tree.xpath(text_xpath, namespaces=element_tree.nsmap)
       value = field.get_value('default')
-      if isinstance(value, (str, unicode)):
-        if isinstance(value, str):
-          value = value.decode('utf-8')
-        value = [value]
-      if isinstance(value, (list, tuple)):
-        value = '\n'.join(value)
-        value.replace('\r', '')
+      if isinstance(value, str):
+        value = value.decode('utf-8')
       for target_node in node_list:
         # render the field in odg xml node format
         attr_dict = {}




More information about the Erp5-report mailing list