From d5c06607b69680f13eece3700d801c5507fb0599 Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Thu, 3 Apr 2014 18:01:33 +0200 Subject: [PATCH] [FIX] Report: in the save_in_attachment logic, when a single report is printed, use the id passed in argument to identify it (and not the qweb branding) bzr revid: sle@openerp.com-20140403160133-4axmxhw7bq2yf94l --- addons/report/models/report.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/report/models/report.py b/addons/report/models/report.py index bf1b34b9f2a..9a65134b0b1 100644 --- a/addons/report/models/report.py +++ b/addons/report/models/report.py @@ -233,6 +233,14 @@ class Report(osv.Model): body = lxml.html.tostring(node) reportcontent = self.MINIMAL_HTML_PAGE.format(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 + # website, when we print a unique report we can use the id passed in argument to + # identify it. + if len(ids) == 1: + reportid = ids[0] + contenthtml.append(tuple([reportid, reportcontent])) except lxml.etree.XMLSyntaxError: