[FIX] remove usage of minidom, use pretty print feature from lxml

This commit is contained in:
Cédric Pigeon
2014-10-15 15:37:54 +02:00
parent f54d362f91
commit 520130abbe

View File

@@ -24,7 +24,6 @@ import time
import copy
from lxml import etree as ET
from xml.dom import minidom as minidom
from openerp import models, fields, api, exceptions
from openerp.tools.translate import _
@@ -220,10 +219,9 @@ class ExportHelpWizard(models.TransientModel):
data_node.append(snippet)
if len(view_data_list) > 0:
rough_string = ET.tostring(xml_to_export, encoding='utf-8',
xml_declaration=True)
reparsed = minidom.parseString(rough_string)
return reparsed.toprettyxml(indent=" ", encoding='utf-8')
return ET.tostring(xml_to_export, encoding='utf-8',
xml_declaration=True,
pretty_print=True)
else:
return False