From ac95d32a222da119d26aebbd23bd5edc41619c96 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Thu, 7 Jun 2007 19:48:41 +0000 Subject: [PATCH] Developments for report designer base_report_designer module allows you to create your own reports reports and images are stored in the database custom report may override base reports RML modification You can now select to put the image in the RML instead than in a separate file bzr revid: fp@tinyerp.com-d15a6508d4dc07abfa294fc980649935816cd60f --- addons/account/account_report.xml | 2 + addons/base_report_designer/__init__.py | 30 + addons/base_report_designer/__terp__.py | 20 + .../base_report_designer_wizard.xml | 22 + .../base_report_designer/wizard/__init__.py | 29 + .../wizard/base_report_designer_modify.py | 221 ++++++ .../wizard/tiny_sxw2rml/__init__.py | 29 + .../wizard/tiny_sxw2rml/normalized_oo2rml.xsl | 644 ++++++++++++++++++ .../wizard/tiny_sxw2rml/office.dtd | 0 .../wizard/tiny_sxw2rml/tiny_sxw2rml.py | 363 ++++++++++ 10 files changed, 1360 insertions(+) create mode 100644 addons/base_report_designer/__init__.py create mode 100644 addons/base_report_designer/__terp__.py create mode 100644 addons/base_report_designer/base_report_designer_wizard.xml create mode 100644 addons/base_report_designer/wizard/__init__.py create mode 100644 addons/base_report_designer/wizard/base_report_designer_modify.py create mode 100644 addons/base_report_designer/wizard/tiny_sxw2rml/__init__.py create mode 100644 addons/base_report_designer/wizard/tiny_sxw2rml/normalized_oo2rml.xsl create mode 100644 addons/base_report_designer/wizard/tiny_sxw2rml/office.dtd create mode 100755 addons/base_report_designer/wizard/tiny_sxw2rml/tiny_sxw2rml.py diff --git a/addons/account/account_report.xml b/addons/account/account_report.xml index 6a230a56a68..1e1e6fc8916 100644 --- a/addons/account/account_report.xml +++ b/addons/account/account_report.xml @@ -59,12 +59,14 @@ model="res.partner" name="account.rappel" rml="account/report/rappel.rml" + sxw="account/report/rappel.sxw" auto="False" /> +# +# 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. +# +############################################################################## + +import account_simulation +import wizard diff --git a/addons/base_report_designer/__terp__.py b/addons/base_report_designer/__terp__.py new file mode 100644 index 00000000000..5b5a58aa5db --- /dev/null +++ b/addons/base_report_designer/__terp__.py @@ -0,0 +1,20 @@ +{ + "name" : "Report designer interface module", + "description" : """ +This module adds wizards to import/export documents to be edited in +OpenOffice. +""", + "version" : "1.0", + "depends" : ["account"], + "author" : "Tiny", + "website" : "http://tinyerp.com", + "category" : "Generic Modules/Base", + "init_xml" : [ ], + "demo_xml" : [ ], + "update_xml" : [ "base_report_designer_wizard.xml" ], +# "translations" : { +# "fr": "i18n/french_fr.csv" +# }, + "active": False, + "installable": True +} diff --git a/addons/base_report_designer/base_report_designer_wizard.xml b/addons/base_report_designer/base_report_designer_wizard.xml new file mode 100644 index 00000000000..ee2ede762cb --- /dev/null +++ b/addons/base_report_designer/base_report_designer_wizard.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + diff --git a/addons/base_report_designer/wizard/__init__.py b/addons/base_report_designer/wizard/__init__.py new file mode 100644 index 00000000000..b3bb16434f6 --- /dev/null +++ b/addons/base_report_designer/wizard/__init__.py @@ -0,0 +1,29 @@ +############################################################################## +# +# Copyright (c) 2004 TINY SPRL. (http://tiny.be) All Rights Reserved. +# Fabien Pinckaers +# +# 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. +# +############################################################################## + +import base_report_designer_modify diff --git a/addons/base_report_designer/wizard/base_report_designer_modify.py b/addons/base_report_designer/wizard/base_report_designer_modify.py new file mode 100644 index 00000000000..3bb949c1d06 --- /dev/null +++ b/addons/base_report_designer/wizard/base_report_designer_modify.py @@ -0,0 +1,221 @@ +############################################################################## +# +# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved. +# +# 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. +# +############################################################################## + +import time +import wizard +import osv +import pooler +import urllib +import base64 +import tools + +intro_form = ''' +
+ + +''' + +intro_fields = { + 'text': { + 'string':'Introduction', + 'type':'text', + 'readonly':True, + 'default': lambda *args: """ +This system must be used with the Tiny OpenOffice plugin. If you +did not installed yet, you can find this package on: + http://tinyerp.com + +This wizard will provide you the .SXW report that you can modify +in OpenOffice. After having modified it, you will be able to reupload +it to the Tiny ERP server. +"""}, + 'operation': { + 'string':'Operation', + 'type':'selection', + 'selection':[('create','Create a new report'),('modify','Modify an existing report')], + 'size':32, + 'required':True, + 'default':lambda *args: 'create' + }, +} + +get_form = ''' +
+ + +''' + +get_fields = { + 'report_id': { + 'string':'Report', + 'type':'many2one', + 'relation':'ir.actions.report.xml', + 'required':True, + 'domain': [('report_sxw_content','<>',False)] + }, +} + +get_form_result = ''' +
+ + + + + +