diff --git a/product/ERP5Form/ListBox.py b/product/ERP5Form/ListBox.py index 0813c944a2a0ac18dcd0f3ec90d2e0b8063020a9..b8d53267ab1ce2eb5b3edf01ba3551592f9cb550 100755 --- a/product/ERP5Form/ListBox.py +++ b/product/ERP5Form/ListBox.py @@ -1515,11 +1515,24 @@ onChange="submitAction(this.form,'%s/portal_selections/setReportRoot')"> # Add item to list_result_item for list render format - if render_format == 'list': - column_value = my_field._get_default(my_field.generate_field_key(), attribute_original_value, o) - if type(column_value) is type(''): - column_value = unicode(column_value, 'utf-8') - current_listboxline.addColumn(property_id , column_value) +# if render_format == 'list': +# column_value = my_field._get_default(my_field.generate_field_key(), attribute_original_value, o) +# if type(column_value) is type(u''): +# #column_value = unicode(column_value, 'utf-8') +# column_value = column_value.encode('utf-8') +# current_listboxline.addColumn(property_id , column_value) + if render_format == 'list': + # Make sure that attribute value is UTF-8 + attribute_value_tmp = attribute_original_value + if type(attribute_value_tmp) == type(u''): + attribute_value_tmp = attribute_original_value.encode('utf-8') + + # XXX this is horrible, but it would be better without those .... + if type(attribute_value_tmp) == type(''): + if 'nbsp' in attribute_value_tmp: + attribute_value_tmp = None + + current_listboxline.addColumn( property_id , attribute_value_tmp) else: # Check if url_columns defines a method to retrieve the URL.