-
-
-
-
-
- {subst}
-
-
- {body}
-
-"""
-
#--------------------------------------------------------------------------
# Extension of ir_ui_view.render with arguments frequently used in reports
#--------------------------------------------------------------------------
@@ -198,6 +179,11 @@ class Report(osv.Model):
footerhtml = []
base_url = self.pool['ir.config_parameter'].get_param(cr, uid, 'web.base.url')
+ # Minimal page renderer
+ view_obj = self.pool['ir.ui.view']
+ render_minimal = partial(view_obj.render, cr, uid, 'report.minimal_layout', context=context)
+
+
# The received html report must be simplified. We convert it in a xml tree
# in order to extract headers, bodies and footers.
try:
@@ -208,12 +194,12 @@ class Report(osv.Model):
for node in root.xpath("//div[@class='header']"):
body = lxml.html.tostring(node)
- header = self.MINIMAL_HTML_PAGE.format(css=css, subst=subst, body=body, base_url=base_url)
+ header = render_minimal(dict(css=css, subst=subst, body=body, base_url=base_url))
headerhtml.append(header)
for node in root.xpath("//div[@class='footer']"):
body = lxml.html.tostring(node)
- footer = self.MINIMAL_HTML_PAGE.format(css=css, subst=subst, body=body, base_url=base_url)
+ footer = render_minimal(dict(css=css, subst=subst, body=body, base_url=base_url))
footerhtml.append(footer)
for node in root.xpath("//div[@class='page']"):
@@ -230,7 +216,7 @@ class Report(osv.Model):
reportid = False
body = lxml.html.tostring(node)
- reportcontent = self.MINIMAL_HTML_PAGE.format(css=css, subst='', body=body, base_url=base_url)
+ reportcontent = render_minimal(dict(css=css, subst='', body=body, base_url=base_url))
# FIXME: imo the best way to extract record id from html reports is by using the
# qweb branding. As website editor is not yet splitted in a module independant from
diff --git a/addons/report/views/layouts.xml b/addons/report/views/layouts.xml
index 4de6717a47d..e5ce9a896fb 100644
--- a/addons/report/views/layouts.xml
+++ b/addons/report/views/layouts.xml
@@ -150,5 +150,23 @@
+
+
+ <!DOCTYPE html>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+