From 2f3aa63617d6b951202cfb9a20bc1d4242444544 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 8 Jul 2014 14:39:24 +0200 Subject: [PATCH] [FIX] compile of rst module descriptions to HTML lxml (used by the html sanitizer) really does not like documents as unicode strings with an encoding declaration (which doesn't make sense indeed), yet docutils with output_encoding=unicode generates one (a stupid one too, says "encoding=unicode"). Disable the xml declaration altogether when compiling rST module declarations to HTML. --- openerp/addons/base/module/module.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openerp/addons/base/module/module.py b/openerp/addons/base/module/module.py index 89f3e9d006e..4c181575852 100644 --- a/openerp/addons/base/module/module.py +++ b/openerp/addons/base/module/module.py @@ -177,7 +177,12 @@ class module(osv.osv): element.set('src', "/%s/static/description/%s" % (module.name, element.get('src'))) res[module.id] = lxml.html.tostring(html) else: - overrides = dict(embed_stylesheet=False, doctitle_xform=False, output_encoding='unicode') + overrides = { + 'embed_stylesheet': False, + 'doctitle_xform': False, + 'output_encoding': 'unicode', + 'xml_declaration': False, + } output = publish_string(source=module.description, settings_overrides=overrides, writer=MyWriter()) res[module.id] = output return res