From f2f833dc8595e3c6a49880a13f5bd2aee7ff304a Mon Sep 17 00:00:00 2001 From: "nicolas.bessi@camptocamp.com" <> Date: Thu, 19 Jan 2012 16:15:50 +0100 Subject: [PATCH 1/3] [IMP] webkit_header attribute support in report tag bzr revid: nicolas.bessi@camptocamp.com-20120119151550-mhf65bzbh9yqprhg --- addons/report_webkit/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/report_webkit/__init__.py b/addons/report_webkit/__init__.py index e09f929ad56..dd44517e787 100644 --- a/addons/report_webkit/__init__.py +++ b/addons/report_webkit/__init__.py @@ -35,5 +35,6 @@ import report_helper import webkit_report import ir_report import wizard +import convert # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From eba6796bb83c92ee7f82c073ae5ae63f34aa6279 Mon Sep 17 00:00:00 2001 From: "nicolas.bessi@camptocamp.com" <> Date: Thu, 19 Jan 2012 16:16:30 +0100 Subject: [PATCH 2/3] [IMP] webkit_header attribute support in report tag bzr revid: nicolas.bessi@camptocamp.com-20120119151630-d4uk78wl1y2tb282 --- addons/report_webkit/convert.py | 56 +++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 addons/report_webkit/convert.py diff --git a/addons/report_webkit/convert.py b/addons/report_webkit/convert.py new file mode 100644 index 00000000000..eb5726346c7 --- /dev/null +++ b/addons/report_webkit/convert.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) +# All Right Reserved +# +# Author : Nicolas Bessi (Camptocamp) +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from tools import convert + +original_xml_import = convert.xml_import + +class WebkitXMLImport(original_xml_import): + + # Override of xml import in order to add webkit_header tag in report tag. + # This was done with agreement of Olivier Dony as the XML api does not offer enought flexibity + # The solution is not meant to be long term solution + def _tag_report(self, cr, rec, data_node=None): + if rec.get('report_type') == 'webkit': + header = rec.get('webkit_header') + report_id = super(WebkitXMLImport, self)._tag_report(cr, rec, data_node) + report_obj = self.pool.get('ir.actions.report.xml') + if header: + if header in ('False', '0', 'None'): + report_obj.write(cr, self.uid, report_id, {'webkit_header': False}) + else: + webkit_header_id = self.id_get(cr, header) + report_obj.write(cr, self.uid, report_id, {'webkit_header': webkit_header_id}) + return report_id + else: + return super(WebkitXMLImport, self)._tag_report(cr, rec, data_node) + +convert.xml_import = WebkitXMLImport From ad5dcb95c8fef09a3cc761dd5287e5ff35f66886 Mon Sep 17 00:00:00 2001 From: "nicolas.bessi@camptocamp.com" <> Date: Thu, 19 Jan 2012 16:19:45 +0100 Subject: [PATCH 3/3] [IMP] webkit_header attribute support in report tag sample bzr revid: nicolas.bessi@camptocamp.com-20120119151945-aog5d6p3b59upvr8 --- addons/report_webkit_sample/report_webkit_html_view.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/report_webkit_sample/report_webkit_html_view.xml b/addons/report_webkit_sample/report_webkit_html_view.xml index b4839496de2..4616c01e908 100644 --- a/addons/report_webkit_sample/report_webkit_html_view.xml +++ b/addons/report_webkit_sample/report_webkit_html_view.xml @@ -1,6 +1,13 @@ - +