summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Lejeune <sle@openerp.com>2015-09-28 17:37:00 +0200
committerSimon Lejeune <sle@openerp.com>2015-09-28 18:17:16 +0200
commit2fa34fcfef9d48465e38e46c3cf4efae0ba58ff9 (patch)
tree65c9a754cb8704ebb38821844086b821e2842e30
parentfa4b170a319d026197ba4c69172c4f431e31815e (diff)
[REF] report: remove css parsing from get_pdf
Useless now that rev f26988c allows the use of asset. Also, it was partly used to retrieve the content of the `report.style` template that was removed by rev c9492f8. The preferred way to add local style and stylesheets is to add them directly in the assets.
-rw-r--r--addons/report/models/report.py10
-rw-r--r--addons/report/views/layouts.xml1
2 files changed, 3 insertions, 8 deletions
diff --git a/addons/report/models/report.py b/addons/report/models/report.py
index 7ba71a1f79e..5963bbef56f 100644
--- a/addons/report/models/report.py
+++ b/addons/report/models/report.py
@@ -165,7 +165,6 @@ class Report(osv.Model):
paperformat = report.paperformat_id
# Preparing the minimal html pages
- css = '' # Will contain local css
headerhtml = []
contenthtml = []
footerhtml = []
@@ -182,17 +181,14 @@ class Report(osv.Model):
root = lxml.html.fromstring(html)
match_klass = "//div[contains(concat(' ', normalize-space(@class), ' '), ' {} ')]"
- for node in root.xpath("//html/head/style"):
- css += node.text
-
for node in root.xpath(match_klass.format('header')):
body = lxml.html.tostring(node)
- header = render_minimal(dict(css=css, subst=True, body=body, base_url=base_url))
+ header = render_minimal(dict(subst=True, body=body, base_url=base_url))
headerhtml.append(header)
for node in root.xpath(match_klass.format('footer')):
body = lxml.html.tostring(node)
- footer = render_minimal(dict(css=css, subst=True, body=body, base_url=base_url))
+ footer = render_minimal(dict(subst=True, body=body, base_url=base_url))
footerhtml.append(footer)
for node in root.xpath(match_klass.format('page')):
@@ -213,7 +209,7 @@ class Report(osv.Model):
# Extract the body
body = lxml.html.tostring(node)
- reportcontent = render_minimal(dict(css=css, subst=False, body=body, base_url=base_url))
+ reportcontent = render_minimal(dict(subst=False, body=body, base_url=base_url))
contenthtml.append(tuple([reportid, reportcontent]))
diff --git a/addons/report/views/layouts.xml b/addons/report/views/layouts.xml
index acbabe608dc..afabd91df46 100644
--- a/addons/report/views/layouts.xml
+++ b/addons/report/views/layouts.xml
@@ -162,7 +162,6 @@
<head>
<t t-call-assets="report.assets_pdf"/>
<t t-call-assets="report.assets_common"/>
- <style type='text/css'><t t-raw="css"/></style>
<t t-if="subst is True">
<script>
function subst() {