From 43a69d36fce583c2b57a57f05aa754be599ba648 Mon Sep 17 00:00:00 2001 From: Fabien Morin <fabien@nexedi.com> Date: Tue, 29 Dec 2009 17:27:51 +0000 Subject: [PATCH] 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 git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31525 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5OOo/FormPrintout.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/product/ERP5OOo/FormPrintout.py b/product/ERP5OOo/FormPrintout.py index 68ee995ab0..8034d0a5f2 100644 --- a/product/ERP5OOo/FormPrintout.py +++ b/product/ERP5OOo/FormPrintout.py @@ -1030,13 +1030,8 @@ class ODGStrategy(ODFStrategy): 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 = {} -- 2.30.9