Merge lp:~tadeus-prastowo/openobject-jasper-reports/7.0 into lp:openobject-jasper-reports/7.0
- 7.0
- Merge into 7.0
Proposed by
Tadeus Prastowo
Status: | Merged |
---|---|
Merged at revision: | 181 |
Proposed branch: | lp:~tadeus-prastowo/openobject-jasper-reports/7.0 |
Merge into: | lp:openobject-jasper-reports/7.0 |
Diff against target: |
846 lines (+393/-61) 10 files modified
jasper_reports/JasperReports/BrowseDataGenerator.py (+16/-6) jasper_reports/JasperReports/JasperReport.py (+20/-9) jasper_reports/JasperReports/JasperServer.py (+16/-5) jasper_reports/__init__.py (+13/-3) jasper_reports/__openerp__.py (+11/-4) jasper_reports/i18n/ca@valencia.po (+217/-0) jasper_reports/i18n/fr.po (+9/-7) jasper_reports/jasper_report.py (+27/-14) jasper_reports/report_xml.py (+19/-7) jasper_reports/wizard/jasper_create_data_template.py (+45/-6) |
To merge this branch: | bzr merge lp:~tadeus-prastowo/openobject-jasper-reports/7.0 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Omar (Pexego) | Approve | ||
Review via email:
|
This proposal supersedes a proposal from 2013-06-10.
Commit message
Description of the change
Make jasper_reports module run under OpenERP version 7.0 upwards by adjusting the import statements to comply with OpenERP 7.0 explicit namespaces.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'jasper_reports/JasperReports/BrowseDataGenerator.py' | |||
2 | --- jasper_reports/JasperReports/BrowseDataGenerator.py 2012-03-05 19:01:02 +0000 | |||
3 | +++ jasper_reports/JasperReports/BrowseDataGenerator.py 2013-06-10 04:33:29 +0000 | |||
4 | @@ -5,6 +5,8 @@ | |||
5 | 5 | # http://www.NaN-tic.com | 5 | # http://www.NaN-tic.com |
6 | 6 | # Copyright (c) 2012 Omar Castiñeira Saavedra <omar@pexego.es> | 6 | # Copyright (c) 2012 Omar Castiñeira Saavedra <omar@pexego.es> |
7 | 7 | # Pexego Sistemas Informáticos http://www.pexego.es | 7 | # Pexego Sistemas Informáticos http://www.pexego.es |
8 | 8 | # Copyright (C) 2013 Tadeus Prastowo <tadeus.prastowo@infi-nity.com> | ||
9 | 9 | # Vikasa Infinity Anugrah <http://www.infi-nity.com> | ||
10 | 8 | # | 10 | # |
11 | 9 | # WARNING: This program as such is intended to be used by professional | 11 | # WARNING: This program as such is intended to be used by professional |
12 | 10 | # programmers who take the whole responsability of assessing all potential | 12 | # programmers who take the whole responsability of assessing all potential |
13 | @@ -34,7 +36,15 @@ | |||
14 | 34 | import copy | 36 | import copy |
15 | 35 | import base64 | 37 | import base64 |
16 | 36 | from xml.dom.minidom import getDOMImplementation | 38 | from xml.dom.minidom import getDOMImplementation |
18 | 37 | from osv import orm, osv, fields | 39 | |
19 | 40 | try: | ||
20 | 41 | import release | ||
21 | 42 | from osv import orm, osv, fields | ||
22 | 43 | except ImportError: | ||
23 | 44 | import openerp | ||
24 | 45 | from openerp import release | ||
25 | 46 | from openerp.osv import orm, osv, fields | ||
26 | 47 | |||
27 | 38 | import tempfile | 48 | import tempfile |
28 | 39 | import codecs | 49 | import codecs |
29 | 40 | import logging | 50 | import logging |
30 | @@ -55,7 +65,7 @@ | |||
31 | 55 | self.imageFiles = {} | 65 | self.imageFiles = {} |
32 | 56 | self.temporaryFiles = [] | 66 | self.temporaryFiles = [] |
33 | 57 | self.logger = logging.getLogger(__name__) | 67 | self.logger = logging.getLogger(__name__) |
35 | 58 | 68 | ||
36 | 59 | def warning(self, message): | 69 | def warning(self, message): |
37 | 60 | if self.logger: | 70 | if self.logger: |
38 | 61 | self.logger.warning("%s" % message) | 71 | self.logger.warning("%s" % message) |
39 | @@ -124,7 +134,7 @@ | |||
40 | 124 | # If we wanted an INNER JOIN we wouldn't check for "value" and | 134 | # If we wanted an INNER JOIN we wouldn't check for "value" and |
41 | 125 | # return an empty currentRecords | 135 | # return an empty currentRecords |
42 | 126 | if value: | 136 | if value: |
44 | 127 | # Only | 137 | # Only |
45 | 128 | newRecords = [] | 138 | newRecords = [] |
46 | 129 | for v in value: | 139 | for v in value: |
47 | 130 | currentNewRecords = [] | 140 | currentNewRecords = [] |
48 | @@ -137,7 +147,7 @@ | |||
49 | 137 | 147 | ||
50 | 138 | currentRecords = newRecords | 148 | currentRecords = newRecords |
51 | 139 | return currentRecords | 149 | return currentRecords |
53 | 140 | 150 | ||
54 | 141 | class XmlBrowseDataGenerator(BrowseDataGenerator): | 151 | class XmlBrowseDataGenerator(BrowseDataGenerator): |
55 | 142 | # XML file generation works as follows: | 152 | # XML file generation works as follows: |
56 | 143 | # By default (if no OPENERP_RELATIONS property exists in the report) a record will be created | 153 | # By default (if no OPENERP_RELATIONS property exists in the report) a record will be created |
57 | @@ -229,7 +239,7 @@ | |||
58 | 229 | elif value == False: | 239 | elif value == False: |
59 | 230 | value = '' | 240 | value = '' |
60 | 231 | elif field_type == 'date': | 241 | elif field_type == 'date': |
62 | 232 | value = '%s 00:00:00' % str(value) | 242 | value = '%s 00:00:00' % str(value) |
63 | 233 | elif field_type == 'binary': | 243 | elif field_type == 'binary': |
64 | 234 | imageId = (record.id, field) | 244 | imageId = (record.id, field) |
65 | 235 | if imageId in self.imageFiles: | 245 | if imageId in self.imageFiles: |
66 | @@ -384,7 +394,7 @@ | |||
67 | 384 | elif value in (False,None): | 394 | elif value in (False,None): |
68 | 385 | value = '' | 395 | value = '' |
69 | 386 | elif field_type == 'date': | 396 | elif field_type == 'date': |
71 | 387 | value = '%s 00:00:00' % str(value) | 397 | value = '%s 00:00:00' % str(value) |
72 | 388 | elif field_type == 'binary': | 398 | elif field_type == 'binary': |
73 | 389 | imageId = (record.id, field) | 399 | imageId = (record.id, field) |
74 | 390 | if imageId in self.imageFiles: | 400 | if imageId in self.imageFiles: |
75 | 391 | 401 | ||
76 | === modified file 'jasper_reports/JasperReports/JasperReport.py' | |||
77 | --- jasper_reports/JasperReports/JasperReport.py 2012-03-04 01:25:44 +0000 | |||
78 | +++ jasper_reports/JasperReports/JasperReport.py 2013-06-10 04:33:29 +0000 | |||
79 | @@ -1,7 +1,10 @@ | |||
80 | 1 | # -*- encoding: utf-8 -*- | ||
81 | 1 | ############################################################################## | 2 | ############################################################################## |
82 | 2 | # | 3 | # |
83 | 3 | # Copyright (c) 2008-2012 NaN Projectes de Programari Lliure, S.L. | 4 | # Copyright (c) 2008-2012 NaN Projectes de Programari Lliure, S.L. |
84 | 4 | # http://www.NaN-tic.com | 5 | # http://www.NaN-tic.com |
85 | 6 | # Copyright (C) 2013 Tadeus Prastowo <tadeus.prastowo@infi-nity.com> | ||
86 | 7 | # Vikasa Infinity Anugrah <http://www.infi-nity.com> | ||
87 | 5 | # | 8 | # |
88 | 6 | # WARNING: This program as such is intended to be used by professional | 9 | # WARNING: This program as such is intended to be used by professional |
89 | 7 | # programmers who take the whole responsability of assessing all potential | 10 | # programmers who take the whole responsability of assessing all potential |
90 | @@ -29,8 +32,16 @@ | |||
91 | 29 | import os | 32 | import os |
92 | 30 | from lxml import etree | 33 | from lxml import etree |
93 | 31 | import re | 34 | import re |
96 | 32 | from tools.safe_eval import safe_eval | 35 | |
97 | 33 | import tools | 36 | try: |
98 | 37 | import release | ||
99 | 38 | from tools.safe_eval import safe_eval | ||
100 | 39 | import tools | ||
101 | 40 | except ImportError: | ||
102 | 41 | import openerp | ||
103 | 42 | from openerp import release | ||
104 | 43 | from openerp.tools.safe_eval import safe_eval | ||
105 | 44 | from openerp import tools | ||
106 | 34 | 45 | ||
107 | 35 | dataSourceExpressionRegExp = re.compile( r"""\$P\{(\w+)\}""" ) | 46 | dataSourceExpressionRegExp = re.compile( r"""\$P\{(\w+)\}""" ) |
108 | 36 | 47 | ||
109 | @@ -121,10 +132,10 @@ | |||
110 | 121 | } | 132 | } |
111 | 122 | fieldNames.append( name ) | 133 | fieldNames.append( name ) |
112 | 123 | return fields, fieldNames | 134 | return fields, fieldNames |
114 | 124 | 135 | ||
115 | 125 | def extractProperties(self): | 136 | def extractProperties(self): |
116 | 126 | # The function will read all relevant information from the jrxml file | 137 | # The function will read all relevant information from the jrxml file |
118 | 127 | 138 | ||
119 | 128 | doc = etree.parse( self._reportPath ) | 139 | doc = etree.parse( self._reportPath ) |
120 | 129 | 140 | ||
121 | 130 | # Define namespaces | 141 | # Define namespaces |
122 | @@ -132,14 +143,14 @@ | |||
123 | 132 | nss = {'jr': ns} | 143 | nss = {'jr': ns} |
124 | 133 | 144 | ||
125 | 134 | # Language | 145 | # Language |
127 | 135 | 146 | ||
128 | 136 | # Note that if either queryString or language do not exist the default (from the constructor) | 147 | # Note that if either queryString or language do not exist the default (from the constructor) |
129 | 137 | # is XPath. | 148 | # is XPath. |
130 | 138 | langTags = doc.xpath( '/jr:jasperReport/jr:queryString', namespaces=nss ) | 149 | langTags = doc.xpath( '/jr:jasperReport/jr:queryString', namespaces=nss ) |
131 | 139 | if langTags: | 150 | if langTags: |
132 | 140 | if langTags[0].get('language'): | 151 | if langTags[0].get('language'): |
133 | 141 | self._language = langTags[0].get('language').lower() | 152 | self._language = langTags[0].get('language').lower() |
135 | 142 | 153 | ||
136 | 143 | # Relations | 154 | # Relations |
137 | 144 | relationTags = doc.xpath( '/jr:jasperReport/jr:property[@name="OPENERP_RELATIONS"]', namespaces=nss ) | 155 | relationTags = doc.xpath( '/jr:jasperReport/jr:property[@name="OPENERP_RELATIONS"]', namespaces=nss ) |
138 | 145 | if relationTags and 'value' in relationTags[0].keys(): | 156 | if relationTags and 'value' in relationTags[0].keys(): |
139 | @@ -209,7 +220,7 @@ | |||
140 | 209 | modelTags = tag.xpath( '//jr:reportElement/jr:property[@name="OPENERP_MODEL"]', namespaces=nss ) | 220 | modelTags = tag.xpath( '//jr:reportElement/jr:property[@name="OPENERP_MODEL"]', namespaces=nss ) |
141 | 210 | if modelTags and 'value' in modelTags[0].keys(): | 221 | if modelTags and 'value' in modelTags[0].keys(): |
142 | 211 | model = modelTags[0].get('value') | 222 | model = modelTags[0].get('value') |
144 | 212 | 223 | ||
145 | 213 | pathPrefix = '' | 224 | pathPrefix = '' |
146 | 214 | pathPrefixTags = tag.xpath( '//jr:reportElement/jr:property[@name="OPENERP_PATH_PREFIX"]', namespaces=nss ) | 225 | pathPrefixTags = tag.xpath( '//jr:reportElement/jr:property[@name="OPENERP_PATH_PREFIX"]', namespaces=nss ) |
147 | 215 | if pathPrefixTags and 'value' in pathPrefixTags[0].keys(): | 226 | if pathPrefixTags and 'value' in pathPrefixTags[0].keys(): |
148 | @@ -239,7 +250,7 @@ | |||
149 | 239 | }) | 250 | }) |
150 | 240 | for subsubInfo in subreport.subreports(): | 251 | for subsubInfo in subreport.subreports(): |
151 | 241 | subsubInfo['depth'] += 1 | 252 | subsubInfo['depth'] += 1 |
153 | 242 | # Note hat 'parameter' (the one used to pass report's DataSource) must be | 253 | # Note hat 'parameter' (the one used to pass report's DataSource) must be |
154 | 243 | # the same in all reports | 254 | # the same in all reports |
155 | 244 | self._subreports.append( subsubInfo ) | 255 | self._subreports.append( subsubInfo ) |
156 | 245 | 256 | ||
157 | @@ -294,7 +305,7 @@ | |||
158 | 294 | modelTags = tag.xpath( '../../jr:reportElement/jr:property[@name="OPENERP_MODEL"]', namespaces=nss ) | 305 | modelTags = tag.xpath( '../../jr:reportElement/jr:property[@name="OPENERP_MODEL"]', namespaces=nss ) |
159 | 295 | if modelTags and 'value' in modelTags[0].keys(): | 306 | if modelTags and 'value' in modelTags[0].keys(): |
160 | 296 | model = modelTags[0].get('value') | 307 | model = modelTags[0].get('value') |
162 | 297 | 308 | ||
163 | 298 | pathPrefix = '' | 309 | pathPrefix = '' |
164 | 299 | pathPrefixTags = tag.xpath( '../../jr:reportElement/jr:property[@name="OPENERP_PATH_PREFIX"]', namespaces=nss ) | 310 | pathPrefixTags = tag.xpath( '../../jr:reportElement/jr:property[@name="OPENERP_PATH_PREFIX"]', namespaces=nss ) |
165 | 300 | if pathPrefixTags and 'value' in pathPrefixTags[0].keys(): | 311 | if pathPrefixTags and 'value' in pathPrefixTags[0].keys(): |
166 | 301 | 312 | ||
167 | === modified file 'jasper_reports/JasperReports/JasperServer.py' | |||
168 | --- jasper_reports/JasperReports/JasperServer.py 2012-03-05 19:01:02 +0000 | |||
169 | +++ jasper_reports/JasperReports/JasperServer.py 2013-06-10 04:33:29 +0000 | |||
170 | @@ -1,7 +1,10 @@ | |||
171 | 1 | # -*- encoding: utf-8 -*- | ||
172 | 1 | ############################################################################## | 2 | ############################################################################## |
173 | 2 | # | 3 | # |
174 | 3 | # Copyright (c) 2008-2012 NaN Projectes de Programari Lliure, S.L. | 4 | # Copyright (c) 2008-2012 NaN Projectes de Programari Lliure, S.L. |
175 | 4 | # http://www.NaN-tic.com | 5 | # http://www.NaN-tic.com |
176 | 6 | # Copyright (C) 2013 Tadeus Prastowo <tadeus.prastowo@infi-nity.com> | ||
177 | 7 | # Vikasa Infinity Anugrah <http://www.infi-nity.com> | ||
178 | 5 | # | 8 | # |
179 | 6 | # WARNING: This program as such is intended to be used by professional | 9 | # WARNING: This program as such is intended to be used by professional |
180 | 7 | # programmers who take the whole responsability of assessing all potential | 10 | # programmers who take the whole responsability of assessing all potential |
181 | @@ -27,15 +30,23 @@ | |||
182 | 27 | ############################################################################## | 30 | ############################################################################## |
183 | 28 | 31 | ||
184 | 29 | import os | 32 | import os |
185 | 30 | from osv import osv | ||
186 | 31 | import glob | 33 | import glob |
187 | 32 | import time | 34 | import time |
188 | 33 | import socket | 35 | import socket |
189 | 34 | import subprocess | 36 | import subprocess |
190 | 35 | import xmlrpclib | 37 | import xmlrpclib |
191 | 36 | from tools.translate import _ | ||
192 | 37 | import logging | 38 | import logging |
193 | 38 | 39 | ||
194 | 40 | try: | ||
195 | 41 | import release | ||
196 | 42 | from osv import osv | ||
197 | 43 | from tools.translate import _ | ||
198 | 44 | except ImportError: | ||
199 | 45 | import openerp | ||
200 | 46 | from openerp import release | ||
201 | 47 | from openerp.osv import osv | ||
202 | 48 | from openerp.tools.translate import _ | ||
203 | 49 | |||
204 | 39 | class JasperServer: | 50 | class JasperServer: |
205 | 40 | def __init__(self, port=8090): | 51 | def __init__(self, port=8090): |
206 | 41 | self.port = port | 52 | self.port = port |
207 | @@ -67,14 +78,14 @@ | |||
208 | 67 | env['CLASSPATH'] = os.path.join( self.path(), '..', 'java' + sep ) + sep.join( glob.glob( libs ) ) + sep + os.path.join( self.path(), '..', 'custom_reports' ) | 78 | env['CLASSPATH'] = os.path.join( self.path(), '..', 'java' + sep ) + sep.join( glob.glob( libs ) ) + sep + os.path.join( self.path(), '..', 'custom_reports' ) |
209 | 68 | cwd = os.path.join( self.path(), '..', 'java' ) | 79 | cwd = os.path.join( self.path(), '..', 'java' ) |
210 | 69 | 80 | ||
212 | 70 | # Set headless = True because otherwise, java may use existing X session and if session is | 81 | # Set headless = True because otherwise, java may use existing X session and if session is |
213 | 71 | # closed JasperServer would start throwing exceptions. So we better avoid using the session at all. | 82 | # closed JasperServer would start throwing exceptions. So we better avoid using the session at all. |
214 | 72 | command = ['java', '-Djava.awt.headless=true', 'com.nantic.jasperreports.JasperServer', unicode(self.port)] | 83 | command = ['java', '-Djava.awt.headless=true', 'com.nantic.jasperreports.JasperServer', unicode(self.port)] |
215 | 73 | process = subprocess.Popen(command, env=env, cwd=cwd) | 84 | process = subprocess.Popen(command, env=env, cwd=cwd) |
216 | 74 | if self.pidfile: | 85 | if self.pidfile: |
217 | 75 | f = open( self.pidfile, 'w') | 86 | f = open( self.pidfile, 'w') |
218 | 76 | try: | 87 | try: |
220 | 77 | f.write( str( process.pid ) ) | 88 | f.write( str( process.pid ) ) |
221 | 78 | finally: | 89 | finally: |
222 | 79 | f.close() | 90 | f.close() |
223 | 80 | 91 | ||
224 | @@ -82,7 +93,7 @@ | |||
225 | 82 | """ | 93 | """ |
226 | 83 | Render report and return the number of pages generated. | 94 | Render report and return the number of pages generated. |
227 | 84 | """ | 95 | """ |
229 | 85 | try: | 96 | try: |
230 | 86 | return self.proxy.Report.execute( *args ) | 97 | return self.proxy.Report.execute( *args ) |
231 | 87 | except (xmlrpclib.ProtocolError, socket.error), e: | 98 | except (xmlrpclib.ProtocolError, socket.error), e: |
232 | 88 | #self.info("First try did not work: %s / %s" % (str(e), str(e.args)) ) | 99 | #self.info("First try did not work: %s / %s" % (str(e), str(e.args)) ) |
233 | 89 | 100 | ||
234 | === modified file 'jasper_reports/__init__.py' | |||
235 | --- jasper_reports/__init__.py 2012-03-04 01:25:44 +0000 | |||
236 | +++ jasper_reports/__init__.py 2013-06-10 04:33:29 +0000 | |||
237 | @@ -1,7 +1,10 @@ | |||
238 | 1 | # -*- encoding: utf-8 -*- | ||
239 | 1 | ############################################################################## | 2 | ############################################################################## |
240 | 2 | # | 3 | # |
241 | 3 | # Copyright (c) 2008-2012 NaN Projectes de Programari Lliure, S.L. | 4 | # Copyright (c) 2008-2012 NaN Projectes de Programari Lliure, S.L. |
242 | 4 | # http://www.NaN-tic.com | 5 | # http://www.NaN-tic.com |
243 | 6 | # Copyright (C) 2013 Tadeus Prastowo <tadeus.prastowo@infi-nity.com> | ||
244 | 7 | # Vikasa Infinity Anugrah <http://www.infi-nity.com> | ||
245 | 5 | # | 8 | # |
246 | 6 | # WARNING: This program as such is intended to be used by professional | 9 | # WARNING: This program as such is intended to be used by professional |
247 | 7 | # programmers who take the whole responsability of assessing all potential | 10 | # programmers who take the whole responsability of assessing all potential |
248 | @@ -25,10 +28,17 @@ | |||
249 | 25 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 28 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
250 | 26 | # | 29 | # |
251 | 27 | ############################################################################## | 30 | ############################################################################## |
252 | 31 | |||
253 | 28 | from jasper_report import * | 32 | from jasper_report import * |
254 | 29 | from report_xml import * | 33 | from report_xml import * |
255 | 30 | import wizard | 34 | import wizard |
256 | 31 | 35 | ||
260 | 32 | import release | 36 | try: |
261 | 33 | if release.major_version != '5.0': | 37 | import release |
262 | 34 | from http_server import * | 38 | if release.major_version != '5.0': |
263 | 39 | from http_server import * | ||
264 | 40 | except ImportError: | ||
265 | 41 | import openerp | ||
266 | 42 | from openerp import release | ||
267 | 43 | if release.major_version != '5.0': | ||
268 | 44 | from openerp.service.http_server import * | ||
269 | 35 | 45 | ||
270 | === modified file 'jasper_reports/__openerp__.py' | |||
271 | --- jasper_reports/__openerp__.py 2012-04-26 17:35:29 +0000 | |||
272 | +++ jasper_reports/__openerp__.py 2013-06-10 04:33:29 +0000 | |||
273 | @@ -1,7 +1,10 @@ | |||
274 | 1 | # -*- encoding: utf-8 -*- | ||
275 | 1 | ############################################################################## | 2 | ############################################################################## |
276 | 2 | # | 3 | # |
277 | 3 | # Copyright (c) 2008-2012 NaN Projectes de Programari Lliure, S.L. | 4 | # Copyright (c) 2008-2012 NaN Projectes de Programari Lliure, S.L. |
278 | 4 | # http://www.NaN-tic.com | 5 | # http://www.NaN-tic.com |
279 | 6 | # Copyright (C) 2013 Tadeus Prastowo <tadeus.prastowo@infi-nity.com> | ||
280 | 7 | # Vikasa Infinity Anugrah <http://www.infi-nity.com> | ||
281 | 5 | # | 8 | # |
282 | 6 | # WARNING: This program as such is intended to be used by professional | 9 | # WARNING: This program as such is intended to be used by professional |
283 | 7 | # programmers who take the whole responsability of assessing all potential | 10 | # programmers who take the whole responsability of assessing all potential |
284 | @@ -32,11 +35,15 @@ | |||
285 | 32 | "description" : "This module integrates Jasper Reports with OpenERP.", | 35 | "description" : "This module integrates Jasper Reports with OpenERP.", |
286 | 33 | "author" : "NaN·tic", | 36 | "author" : "NaN·tic", |
287 | 34 | "website" : "http://www.nan-tic.com", | 37 | "website" : "http://www.nan-tic.com", |
288 | 38 | 'images' : [ | ||
289 | 39 | 'images/jasper_reports-hover.png', | ||
290 | 40 | 'images/jasper_reports.png' | ||
291 | 41 | ], | ||
292 | 35 | "depends" : ["base"], | 42 | "depends" : ["base"], |
293 | 36 | "category" : "Generic Modules/Jasper Reports", | 43 | "category" : "Generic Modules/Jasper Reports", |
294 | 37 | "init_xml" : [], | 44 | "init_xml" : [], |
297 | 38 | "demo_xml" : [ | 45 | "demo_xml" : [ |
298 | 39 | 'jasper_demo.xml' | 46 | 'jasper_demo.xml' |
299 | 40 | ], | 47 | ], |
300 | 41 | "update_xml" : [ | 48 | "update_xml" : [ |
301 | 42 | 'wizard/jasper_create_data_template.xml', | 49 | 'wizard/jasper_create_data_template.xml', |
302 | @@ -45,6 +52,6 @@ | |||
303 | 45 | 'security/ir.model.access.csv', | 52 | 'security/ir.model.access.csv', |
304 | 46 | ], | 53 | ], |
305 | 47 | "active": False, | 54 | "active": False, |
307 | 48 | "installable": True | 55 | "installable": True, |
308 | 56 | 'application': True, | ||
309 | 49 | } | 57 | } |
310 | 50 | |||
311 | 51 | 58 | ||
312 | === added file 'jasper_reports/i18n/ca@valencia.po' | |||
313 | --- jasper_reports/i18n/ca@valencia.po 1970-01-01 00:00:00 +0000 | |||
314 | +++ jasper_reports/i18n/ca@valencia.po 2013-06-10 04:33:29 +0000 | |||
315 | @@ -0,0 +1,217 @@ | |||
316 | 1 | # Catalan (Valencian) translation for openobject-jasper-reports | ||
317 | 2 | # Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 | ||
318 | 3 | # This file is distributed under the same license as the openobject-jasper-reports package. | ||
319 | 4 | # FIRST AUTHOR <EMAIL@ADDRESS>, 2013. | ||
320 | 5 | # | ||
321 | 6 | msgid "" | ||
322 | 7 | msgstr "" | ||
323 | 8 | "Project-Id-Version: openobject-jasper-reports\n" | ||
324 | 9 | "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" | ||
325 | 10 | "POT-Creation-Date: 2010-06-27 14:39+0000\n" | ||
326 | 11 | "PO-Revision-Date: 2013-01-08 19:18+0000\n" | ||
327 | 12 | "Last-Translator: Pablo Fuentes Rodríguez (Studio73) <pablo@studio73.es>\n" | ||
328 | 13 | "Language-Team: Catalan (Valencian) <ca@valencia@li.org>\n" | ||
329 | 14 | "MIME-Version: 1.0\n" | ||
330 | 15 | "Content-Type: text/plain; charset=UTF-8\n" | ||
331 | 16 | "Content-Transfer-Encoding: 8bit\n" | ||
332 | 17 | "X-Launchpad-Export-Date: 2013-01-09 05:24+0000\n" | ||
333 | 18 | "X-Generator: Launchpad (build 16412)\n" | ||
334 | 19 | |||
335 | 20 | #. module: jasper_reports | ||
336 | 21 | #: field:ir.actions.report.xml,jasper_report:0 | ||
337 | 22 | msgid "Is Jasper Report?" | ||
338 | 23 | msgstr "Es Jasper Report?" | ||
339 | 24 | |||
340 | 25 | #. module: jasper_reports | ||
341 | 26 | #: constraint:ir.model:0 | ||
342 | 27 | msgid "" | ||
343 | 28 | "The Object name must start with x_ and not contain any special character !" | ||
344 | 29 | msgstr "" | ||
345 | 30 | "El nom de l'objecte ha de començar amb x_ i no pot contenir cap caràcter " | ||
346 | 31 | "especial!" | ||
347 | 32 | |||
348 | 33 | #. module: jasper_reports | ||
349 | 34 | #: wizard_button:jasper_create_data_template,init,create:0 | ||
350 | 35 | msgid "Create" | ||
351 | 36 | msgstr "Crea" | ||
352 | 37 | |||
353 | 38 | #. module: jasper_reports | ||
354 | 39 | #: field:ir.actions.report.xml,jasper_output:0 | ||
355 | 40 | msgid "Jasper Output" | ||
356 | 41 | msgstr "Eixida de Jasper" | ||
357 | 42 | |||
358 | 43 | #. module: jasper_reports | ||
359 | 44 | #: constraint:ir.actions.act_window:0 | ||
360 | 45 | msgid "Invalid model name in the action definition." | ||
361 | 46 | msgstr "Nom de model no vàlid en la definició de l'acció" | ||
362 | 47 | |||
363 | 48 | #. module: jasper_reports | ||
364 | 49 | #: selection:ir.actions.report.xml,jasper_output:0 | ||
365 | 50 | msgid "XLS" | ||
366 | 51 | msgstr "XLS" | ||
367 | 52 | |||
368 | 53 | #. module: jasper_reports | ||
369 | 54 | #: view:ir.actions.report.xml:0 | ||
370 | 55 | #: field:ir.actions.report.xml,jasper_file_ids:0 | ||
371 | 56 | msgid "Files" | ||
372 | 57 | msgstr "Fitxers" | ||
373 | 58 | |||
374 | 59 | #. module: jasper_reports | ||
375 | 60 | #: selection:ir.actions.report.xml,jasper_output:0 | ||
376 | 61 | msgid "RTF" | ||
377 | 62 | msgstr "RTF" | ||
378 | 63 | |||
379 | 64 | #. module: jasper_reports | ||
380 | 65 | #: view:ir.actions.report.xml:0 | ||
381 | 66 | msgid "Update from attachments" | ||
382 | 67 | msgstr "Actualitzar des d'adjunts" | ||
383 | 68 | |||
384 | 69 | #. module: jasper_reports | ||
385 | 70 | #: model:ir.actions.act_window,name:jasper_reports.ir_action_report_jasper | ||
386 | 71 | #: view:ir.actions.report.xml:0 | ||
387 | 72 | #: model:ir.module.module,shortdesc:jasper_reports.module_meta_information | ||
388 | 73 | #: model:ir.ui.menu,name:jasper_reports.jasper_reports_menu | ||
389 | 74 | #: model:ir.ui.menu,name:jasper_reports.menu_ir_action_report_jasper | ||
390 | 75 | msgid "Jasper Reports" | ||
391 | 76 | msgstr "Jasper Reports" | ||
392 | 77 | |||
393 | 78 | #. module: jasper_reports | ||
394 | 79 | #: selection:ir.actions.report.xml,jasper_output:0 | ||
395 | 80 | msgid "ODS" | ||
396 | 81 | msgstr "" | ||
397 | 82 | |||
398 | 83 | #. module: jasper_reports | ||
399 | 84 | #: selection:ir.actions.report.xml,jasper_output:0 | ||
400 | 85 | msgid "ODT" | ||
401 | 86 | msgstr "" | ||
402 | 87 | |||
403 | 88 | #. module: jasper_reports | ||
404 | 89 | #: code:addons/jasper_reports/report_xml.py:0 | ||
405 | 90 | #, python-format | ||
406 | 91 | msgid "There is more than one report marked as default" | ||
407 | 92 | msgstr "" | ||
408 | 93 | |||
409 | 94 | #. module: jasper_reports | ||
410 | 95 | #: selection:ir.actions.report.xml,jasper_output:0 | ||
411 | 96 | msgid "HTML" | ||
412 | 97 | msgstr "" | ||
413 | 98 | |||
414 | 99 | #. module: jasper_reports | ||
415 | 100 | #: code:addons/jasper_reports/wizard/create_data_template.py:0 | ||
416 | 101 | #, python-format | ||
417 | 102 | msgid "User" | ||
418 | 103 | msgstr "" | ||
419 | 104 | |||
420 | 105 | #. module: jasper_reports | ||
421 | 106 | #: view:ir.actions.report.xml:0 | ||
422 | 107 | msgid "Groups" | ||
423 | 108 | msgstr "" | ||
424 | 109 | |||
425 | 110 | #. module: jasper_reports | ||
426 | 111 | #: field:ir.actions.report.xml.file,report_id:0 | ||
427 | 112 | msgid "Report" | ||
428 | 113 | msgstr "" | ||
429 | 114 | |||
430 | 115 | #. module: jasper_reports | ||
431 | 116 | #: wizard_field:jasper_create_data_template,create,data:0 | ||
432 | 117 | msgid "XML" | ||
433 | 118 | msgstr "" | ||
434 | 119 | |||
435 | 120 | #. module: jasper_reports | ||
436 | 121 | #: constraint:ir.ui.view:0 | ||
437 | 122 | msgid "Invalid XML for View Architecture!" | ||
438 | 123 | msgstr "" | ||
439 | 124 | |||
440 | 125 | #. module: jasper_reports | ||
441 | 126 | #: model:ir.model,name:jasper_reports.model_ir_actions_report_xml_file | ||
442 | 127 | msgid "ir.actions.report.xml.file" | ||
443 | 128 | msgstr "" | ||
444 | 129 | |||
445 | 130 | #. module: jasper_reports | ||
446 | 131 | #: model:ir.actions.wizard,name:jasper_reports.jasper_create_data_template_action | ||
447 | 132 | #: model:ir.ui.menu,name:jasper_reports.jasper_create_data_template_menu | ||
448 | 133 | #: wizard_view:jasper_create_data_template,create:0 | ||
449 | 134 | #: wizard_view:jasper_create_data_template,init:0 | ||
450 | 135 | msgid "Create Data Template" | ||
451 | 136 | msgstr "" | ||
452 | 137 | |||
453 | 138 | #. module: jasper_reports | ||
454 | 139 | #: field:ir.actions.report.xml.file,default:0 | ||
455 | 140 | msgid "Default" | ||
456 | 141 | msgstr "" | ||
457 | 142 | |||
458 | 143 | #. module: jasper_reports | ||
459 | 144 | #: code:addons/jasper_reports/report_xml.py:0 | ||
460 | 145 | #, python-format | ||
461 | 146 | msgid "No report has been marked as default." | ||
462 | 147 | msgstr "" | ||
463 | 148 | |||
464 | 149 | #. module: jasper_reports | ||
465 | 150 | #: wizard_field:jasper_create_data_template,init,depth:0 | ||
466 | 151 | msgid "Depth" | ||
467 | 152 | msgstr "" | ||
468 | 153 | |||
469 | 154 | #. module: jasper_reports | ||
470 | 155 | #: code:addons/jasper_reports/report_xml.py:0 | ||
471 | 156 | #, python-format | ||
472 | 157 | msgid "Error" | ||
473 | 158 | msgstr "" | ||
474 | 159 | |||
475 | 160 | #. module: jasper_reports | ||
476 | 161 | #: selection:ir.actions.report.xml,jasper_output:0 | ||
477 | 162 | msgid "PDF" | ||
478 | 163 | msgstr "" | ||
479 | 164 | |||
480 | 165 | #. module: jasper_reports | ||
481 | 166 | #: field:ir.actions.report.xml,jasper_model_id:0 | ||
482 | 167 | #: wizard_field:jasper_create_data_template,create,model:0 | ||
483 | 168 | #: wizard_field:jasper_create_data_template,init,model:0 | ||
484 | 169 | msgid "Model" | ||
485 | 170 | msgstr "" | ||
486 | 171 | |||
487 | 172 | #. module: jasper_reports | ||
488 | 173 | #: selection:ir.actions.report.xml,jasper_output:0 | ||
489 | 174 | msgid "CSV" | ||
490 | 175 | msgstr "" | ||
491 | 176 | |||
492 | 177 | #. module: jasper_reports | ||
493 | 178 | #: view:ir.actions.report.xml.file:0 | ||
494 | 179 | msgid "Jasper Reports File" | ||
495 | 180 | msgstr "" | ||
496 | 181 | |||
497 | 182 | #. module: jasper_reports | ||
498 | 183 | #: code:addons/jasper_reports/wizard/create_data_template.py:0 | ||
499 | 184 | #, python-format | ||
500 | 185 | msgid "Attachments" | ||
501 | 186 | msgstr "" | ||
502 | 187 | |||
503 | 188 | #. module: jasper_reports | ||
504 | 189 | #: selection:ir.actions.report.xml,jasper_output:0 | ||
505 | 190 | msgid "Text" | ||
506 | 191 | msgstr "" | ||
507 | 192 | |||
508 | 193 | #. module: jasper_reports | ||
509 | 194 | #: field:ir.actions.report.xml.file,filename:0 | ||
510 | 195 | #: wizard_field:jasper_create_data_template,create,filename:0 | ||
511 | 196 | msgid "File Name" | ||
512 | 197 | msgstr "" | ||
513 | 198 | |||
514 | 199 | #. module: jasper_reports | ||
515 | 200 | #: wizard_button:jasper_create_data_template,create,end:0 | ||
516 | 201 | msgid "Accept" | ||
517 | 202 | msgstr "" | ||
518 | 203 | |||
519 | 204 | #. module: jasper_reports | ||
520 | 205 | #: model:ir.module.module,description:jasper_reports.module_meta_information | ||
521 | 206 | msgid "This module integrates Jasper Reports with OpenERP." | ||
522 | 207 | msgstr "" | ||
523 | 208 | |||
524 | 209 | #. module: jasper_reports | ||
525 | 210 | #: field:ir.actions.report.xml.file,file:0 | ||
526 | 211 | msgid "File" | ||
527 | 212 | msgstr "" | ||
528 | 213 | |||
529 | 214 | #. module: jasper_reports | ||
530 | 215 | #: wizard_button:jasper_create_data_template,init,end:0 | ||
531 | 216 | msgid "Cancel" | ||
532 | 217 | msgstr "" | ||
533 | 0 | 218 | ||
534 | === modified file 'jasper_reports/i18n/fr.po' | |||
535 | --- jasper_reports/i18n/fr.po 2012-03-05 05:11:35 +0000 | |||
536 | +++ jasper_reports/i18n/fr.po 2013-06-10 04:33:29 +0000 | |||
537 | @@ -8,14 +8,14 @@ | |||
538 | 8 | "Project-Id-Version: OpenERP Server 6.0.3\n" | 8 | "Project-Id-Version: OpenERP Server 6.0.3\n" |
539 | 9 | "Report-Msgid-Bugs-To: support@openerp.com\n" | 9 | "Report-Msgid-Bugs-To: support@openerp.com\n" |
540 | 10 | "POT-Creation-Date: 2010-06-27 14:39+0000\n" | 10 | "POT-Creation-Date: 2010-06-27 14:39+0000\n" |
543 | 11 | "PO-Revision-Date: 2012-03-04 04:36+0000\n" | 11 | "PO-Revision-Date: 2012-04-19 08:53+0000\n" |
544 | 12 | "Last-Translator: Christophe CRIER <Unknown>\n" | 12 | "Last-Translator: Florent (LSc) <Unknown>\n" |
545 | 13 | "Language-Team: French <kde-i18n-doc@kde.org>\n" | 13 | "Language-Team: French <kde-i18n-doc@kde.org>\n" |
546 | 14 | "MIME-Version: 1.0\n" | 14 | "MIME-Version: 1.0\n" |
547 | 15 | "Content-Type: text/plain; charset=UTF-8\n" | 15 | "Content-Type: text/plain; charset=UTF-8\n" |
548 | 16 | "Content-Transfer-Encoding: 8bit\n" | 16 | "Content-Transfer-Encoding: 8bit\n" |
551 | 17 | "X-Launchpad-Export-Date: 2012-03-05 05:11+0000\n" | 17 | "X-Launchpad-Export-Date: 2012-04-20 05:31+0000\n" |
552 | 18 | "X-Generator: Launchpad (build 14900)\n" | 18 | "X-Generator: Launchpad (build 15120)\n" |
553 | 19 | 19 | ||
554 | 20 | #. module: jasper_reports | 20 | #. module: jasper_reports |
555 | 21 | #: field:ir.actions.report.xml,jasper_report:0 | 21 | #: field:ir.actions.report.xml,jasper_report:0 |
556 | @@ -27,6 +27,8 @@ | |||
557 | 27 | msgid "" | 27 | msgid "" |
558 | 28 | "The Object name must start with x_ and not contain any special character !" | 28 | "The Object name must start with x_ and not contain any special character !" |
559 | 29 | msgstr "" | 29 | msgstr "" |
560 | 30 | "Le nom de l'objet doit commencer par x_ et ne doit contenir aucun caractère " | ||
561 | 31 | "spécial !" | ||
562 | 30 | 32 | ||
563 | 31 | #. module: jasper_reports | 33 | #. module: jasper_reports |
564 | 32 | #: wizard_button:jasper_create_data_template,init,create:0 | 34 | #: wizard_button:jasper_create_data_template,init,create:0 |
565 | @@ -41,7 +43,7 @@ | |||
566 | 41 | #. module: jasper_reports | 43 | #. module: jasper_reports |
567 | 42 | #: constraint:ir.actions.act_window:0 | 44 | #: constraint:ir.actions.act_window:0 |
568 | 43 | msgid "Invalid model name in the action definition." | 45 | msgid "Invalid model name in the action definition." |
570 | 44 | msgstr "" | 46 | msgstr "Nom de modèle non valide dans la définition de l'action." |
571 | 45 | 47 | ||
572 | 46 | #. module: jasper_reports | 48 | #. module: jasper_reports |
573 | 47 | #: selection:ir.actions.report.xml,jasper_output:0 | 49 | #: selection:ir.actions.report.xml,jasper_output:0 |
574 | @@ -118,7 +120,7 @@ | |||
575 | 118 | #. module: jasper_reports | 120 | #. module: jasper_reports |
576 | 119 | #: constraint:ir.ui.view:0 | 121 | #: constraint:ir.ui.view:0 |
577 | 120 | msgid "Invalid XML for View Architecture!" | 122 | msgid "Invalid XML for View Architecture!" |
579 | 121 | msgstr "" | 123 | msgstr "XML incorrect pour l'architecture de la vue !" |
580 | 122 | 124 | ||
581 | 123 | #. module: jasper_reports | 125 | #. module: jasper_reports |
582 | 124 | #: model:ir.model,name:jasper_reports.model_ir_actions_report_xml_file | 126 | #: model:ir.model,name:jasper_reports.model_ir_actions_report_xml_file |
583 | @@ -202,7 +204,7 @@ | |||
584 | 202 | #. module: jasper_reports | 204 | #. module: jasper_reports |
585 | 203 | #: model:ir.module.module,description:jasper_reports.module_meta_information | 205 | #: model:ir.module.module,description:jasper_reports.module_meta_information |
586 | 204 | msgid "This module integrates Jasper Reports with OpenERP." | 206 | msgid "This module integrates Jasper Reports with OpenERP." |
588 | 205 | msgstr "" | 207 | msgstr "Ce module intégre Jasper Reports avec OpenERP" |
589 | 206 | 208 | ||
590 | 207 | #. module: jasper_reports | 209 | #. module: jasper_reports |
591 | 208 | #: field:ir.actions.report.xml.file,file:0 | 210 | #: field:ir.actions.report.xml.file,file:0 |
592 | 209 | 211 | ||
593 | === added directory 'jasper_reports/images' | |||
594 | === added file 'jasper_reports/images/jasper_reports-hover.png' | |||
595 | 210 | Binary files jasper_reports/images/jasper_reports-hover.png 1970-01-01 00:00:00 +0000 and jasper_reports/images/jasper_reports-hover.png 2013-06-10 04:33:29 +0000 differ | 212 | Binary files jasper_reports/images/jasper_reports-hover.png 1970-01-01 00:00:00 +0000 and jasper_reports/images/jasper_reports-hover.png 2013-06-10 04:33:29 +0000 differ |
596 | === added file 'jasper_reports/images/jasper_reports.png' | |||
597 | 211 | Binary files jasper_reports/images/jasper_reports.png 1970-01-01 00:00:00 +0000 and jasper_reports/images/jasper_reports.png 2013-06-10 04:33:29 +0000 differ | 213 | Binary files jasper_reports/images/jasper_reports.png 1970-01-01 00:00:00 +0000 and jasper_reports/images/jasper_reports.png 2013-06-10 04:33:29 +0000 differ |
598 | === modified file 'jasper_reports/jasper_report.py' | |||
599 | --- jasper_reports/jasper_report.py 2012-03-07 09:59:57 +0000 | |||
600 | +++ jasper_reports/jasper_report.py 2013-06-10 04:33:29 +0000 | |||
601 | @@ -1,7 +1,10 @@ | |||
602 | 1 | # -*- encoding: utf-8 -*- | ||
603 | 1 | ############################################################################## | 2 | ############################################################################## |
604 | 2 | # | 3 | # |
605 | 3 | # Copyright (c) 2008-2012 NaN Projectes de Programari Lliure, S.L. | 4 | # Copyright (c) 2008-2012 NaN Projectes de Programari Lliure, S.L. |
606 | 4 | # http://www.NaN-tic.com | 5 | # http://www.NaN-tic.com |
607 | 6 | # Copyright (C) 2013 Tadeus Prastowo <tadeus.prastowo@infi-nity.com> | ||
608 | 7 | # Vikasa Infinity Anugrah <http://www.infi-nity.com> | ||
609 | 5 | # | 8 | # |
610 | 6 | # WARNING: This program as such is intended to be used by professional | 9 | # WARNING: This program as such is intended to be used by professional |
611 | 7 | # programmers who take the whole responsability of assessing all potential | 10 | # programmers who take the whole responsability of assessing all potential |
612 | @@ -26,14 +29,24 @@ | |||
613 | 26 | # | 29 | # |
614 | 27 | ############################################################################## | 30 | ############################################################################## |
615 | 28 | 31 | ||
616 | 32 | try: | ||
617 | 33 | import release | ||
618 | 34 | import report | ||
619 | 35 | import pooler | ||
620 | 36 | from osv import orm, osv, fields | ||
621 | 37 | import tools | ||
622 | 38 | import netsvc | ||
623 | 39 | except ImportError: | ||
624 | 40 | import openerp | ||
625 | 41 | from openerp import release | ||
626 | 42 | from openerp import report | ||
627 | 43 | from openerp import pooler | ||
628 | 44 | from openerp.osv import orm, osv, fields | ||
629 | 45 | from openerp import tools | ||
630 | 46 | from openerp import netsvc | ||
631 | 47 | |||
632 | 29 | import os | 48 | import os |
633 | 30 | import report | ||
634 | 31 | import pooler | ||
635 | 32 | from osv import orm, osv, fields | ||
636 | 33 | import tools | ||
637 | 34 | import tempfile | 49 | import tempfile |
638 | 35 | import netsvc | ||
639 | 36 | import release | ||
640 | 37 | import logging | 50 | import logging |
641 | 38 | 51 | ||
642 | 39 | from JasperReports import * | 52 | from JasperReports import * |
643 | @@ -89,7 +102,7 @@ | |||
644 | 89 | logger.info("Requested report: '%s'" % self.reportPath) | 102 | logger.info("Requested report: '%s'" % self.reportPath) |
645 | 90 | self.report = JasperReport( self.reportPath ) | 103 | self.report = JasperReport( self.reportPath ) |
646 | 91 | 104 | ||
648 | 92 | # Create temporary input (XML) and output (PDF) files | 105 | # Create temporary input (XML) and output (PDF) files |
649 | 93 | fd, dataFile = tempfile.mkstemp() | 106 | fd, dataFile = tempfile.mkstemp() |
650 | 94 | os.close(fd) | 107 | os.close(fd) |
651 | 95 | fd, outputFile = tempfile.mkstemp() | 108 | fd, outputFile = tempfile.mkstemp() |
652 | @@ -109,7 +122,7 @@ | |||
653 | 109 | generator = CsvBrowseDataGenerator( self.report, self.model, self.pool, self.cr, self.uid, self.ids, self.context ) | 122 | generator = CsvBrowseDataGenerator( self.report, self.model, self.pool, self.cr, self.uid, self.ids, self.context ) |
654 | 110 | generator.generate( dataFile ) | 123 | generator.generate( dataFile ) |
655 | 111 | self.temporaryFiles += generator.temporaryFiles | 124 | self.temporaryFiles += generator.temporaryFiles |
657 | 112 | 125 | ||
658 | 113 | subreportDataFiles = [] | 126 | subreportDataFiles = [] |
659 | 114 | for subreportInfo in self.report.subreports(): | 127 | for subreportInfo in self.report.subreports(): |
660 | 115 | subreport = subreportInfo['report'] | 128 | subreport = subreportInfo['report'] |
661 | @@ -138,7 +151,7 @@ | |||
662 | 138 | else: | 151 | else: |
663 | 139 | generator = CsvBrowseDataGenerator( subreport, self.model, self.pool, self.cr, self.uid, self.ids, self.context ) | 152 | generator = CsvBrowseDataGenerator( subreport, self.model, self.pool, self.cr, self.uid, self.ids, self.context ) |
664 | 140 | generator.generate( subreportDataFile ) | 153 | generator.generate( subreportDataFile ) |
666 | 141 | 154 | ||
667 | 142 | 155 | ||
668 | 143 | # Call the external java application that will generate the PDF file in outputFile | 156 | # Call the external java application that will generate the PDF file in outputFile |
669 | 144 | pages = self.executeReport( dataFile, outputFile, subreportDataFiles ) | 157 | pages = self.executeReport( dataFile, outputFile, subreportDataFiles ) |
670 | @@ -191,7 +204,7 @@ | |||
671 | 191 | port = tools.config['db_port'] or '5432' | 204 | port = tools.config['db_port'] or '5432' |
672 | 192 | dbname = self.cr.dbname | 205 | dbname = self.cr.dbname |
673 | 193 | return 'jdbc:postgresql://%s:%s/%s' % ( host, port, dbname ) | 206 | return 'jdbc:postgresql://%s:%s/%s' % ( host, port, dbname ) |
675 | 194 | 207 | ||
676 | 195 | def userName(self): | 208 | def userName(self): |
677 | 196 | return tools.config['db_user'] or self.systemUserName() | 209 | return tools.config['db_user'] or self.systemUserName() |
678 | 197 | 210 | ||
679 | @@ -200,7 +213,7 @@ | |||
680 | 200 | 213 | ||
681 | 201 | def executeReport(self, dataFile, outputFile, subreportDataFiles): | 214 | def executeReport(self, dataFile, outputFile, subreportDataFiles): |
682 | 202 | locale = self.context.get('lang', 'en_US') | 215 | locale = self.context.get('lang', 'en_US') |
684 | 203 | 216 | ||
685 | 204 | connectionParameters = { | 217 | connectionParameters = { |
686 | 205 | 'output': self.outputFormat, | 218 | 'output': self.outputFormat, |
687 | 206 | #'xml': dataFile, | 219 | #'xml': dataFile, |
688 | @@ -226,8 +239,8 @@ | |||
689 | 226 | class report_jasper(report.interface.report_int): | 239 | class report_jasper(report.interface.report_int): |
690 | 227 | def __init__(self, name, model, parser=None ): | 240 | def __init__(self, name, model, parser=None ): |
691 | 228 | # Remove report name from list of services if it already | 241 | # Remove report name from list of services if it already |
694 | 229 | # exists to avoid report_int's assert. We want to keep the | 242 | # exists to avoid report_int's assert. We want to keep the |
695 | 230 | # automatic registration at login, but at the same time we | 243 | # automatic registration at login, but at the same time we |
696 | 231 | # need modules to be able to use a parser for certain reports. | 244 | # need modules to be able to use a parser for certain reports. |
697 | 232 | if release.major_version == '5.0': | 245 | if release.major_version == '5.0': |
698 | 233 | if name in netsvc.SERVICES: | 246 | if name in netsvc.SERVICES: |
699 | @@ -277,7 +290,7 @@ | |||
700 | 277 | report_jasper( name, model ) | 290 | report_jasper( name, model ) |
701 | 278 | 291 | ||
702 | 279 | 292 | ||
704 | 280 | # This hack allows automatic registration of jrxml files without | 293 | # This hack allows automatic registration of jrxml files without |
705 | 281 | # the need for developers to register them programatically. | 294 | # the need for developers to register them programatically. |
706 | 282 | 295 | ||
707 | 283 | old_register_all = report.interface.register_all | 296 | old_register_all = report.interface.register_all |
708 | 284 | 297 | ||
709 | === modified file 'jasper_reports/report_xml.py' | |||
710 | --- jasper_reports/report_xml.py 2012-07-27 12:17:55 +0000 | |||
711 | +++ jasper_reports/report_xml.py 2013-06-10 04:33:29 +0000 | |||
712 | @@ -3,6 +3,8 @@ | |||
713 | 3 | # | 3 | # |
714 | 4 | # Copyright (c) 2008-2012 NaN Projectes de Programari Lliure, S.L. | 4 | # Copyright (c) 2008-2012 NaN Projectes de Programari Lliure, S.L. |
715 | 5 | # http://www.NaN-tic.com | 5 | # http://www.NaN-tic.com |
716 | 6 | # Copyright (C) 2013 Tadeus Prastowo <tadeus.prastowo@infi-nity.com> | ||
717 | 7 | # Vikasa Infinity Anugrah <http://www.infi-nity.com> | ||
718 | 6 | # | 8 | # |
719 | 7 | # WARNING: This program as such is intended to be used by professional | 9 | # WARNING: This program as such is intended to be used by professional |
720 | 8 | # programmers who take the whole responsability of assessing all potential | 10 | # programmers who take the whole responsability of assessing all potential |
721 | @@ -29,15 +31,25 @@ | |||
722 | 29 | 31 | ||
723 | 30 | import os | 32 | import os |
724 | 31 | import base64 | 33 | import base64 |
729 | 32 | import report | 34 | |
730 | 33 | from osv import orm, osv, fields | 35 | try: |
731 | 34 | import jasper_report | 36 | import release |
732 | 35 | from tools.translate import _ | 37 | import report |
733 | 38 | from osv import orm, osv, fields | ||
734 | 39 | import jasper_report | ||
735 | 40 | from tools.translate import _ | ||
736 | 41 | except ImportError: | ||
737 | 42 | import openerp | ||
738 | 43 | from openerp import release | ||
739 | 44 | from openerp import report | ||
740 | 45 | from openerp.osv import orm, osv, fields | ||
741 | 46 | from openerp import jasper_report | ||
742 | 47 | from openerp.tools.translate import _ | ||
743 | 36 | 48 | ||
744 | 37 | import unicodedata | 49 | import unicodedata |
745 | 38 | from xml.dom.minidom import getDOMImplementation | 50 | from xml.dom.minidom import getDOMImplementation |
746 | 39 | 51 | ||
748 | 40 | src_chars = """ '"()/*-+?¿!&$[]{}@#`'^:;<>=~%,\\""" | 52 | src_chars = """ '"()/*-+?¿!&$[]{}@#`'^:;<>=~%,\\""" |
749 | 41 | src_chars = unicode( src_chars, 'iso-8859-1' ) | 53 | src_chars = unicode( src_chars, 'iso-8859-1' ) |
750 | 42 | dst_chars = """________________________________""" | 54 | dst_chars = """________________________________""" |
751 | 43 | dst_chars = unicode( dst_chars, 'iso-8859-1' ) | 55 | dst_chars = unicode( dst_chars, 'iso-8859-1' ) |
752 | @@ -180,7 +192,7 @@ | |||
753 | 180 | model = pool.get(modelName) | 192 | model = pool.get(modelName) |
754 | 181 | fields = model._columns.keys() | 193 | fields = model._columns.keys() |
755 | 182 | fields += model._inherit_fields.keys() | 194 | fields += model._inherit_fields.keys() |
757 | 183 | # Remove duplicates because model may have fields with the | 195 | # Remove duplicates because model may have fields with the |
758 | 184 | # same name as it's parent | 196 | # same name as it's parent |
759 | 185 | fields = sorted( list( set( fields ) ) ) | 197 | fields = sorted( list( set( fields ) ) ) |
760 | 186 | for field in fields: | 198 | for field in fields: |
761 | @@ -218,7 +230,7 @@ | |||
762 | 218 | newName = model._inherit_fields[field][2]._obj | 230 | newName = model._inherit_fields[field][2]._obj |
763 | 219 | self.generate_xml(cr, uid, context, pool, newName, fieldNode, document, depth-1, False) | 231 | self.generate_xml(cr, uid, context, pool, newName, fieldNode, document, depth-1, False) |
764 | 220 | continue | 232 | continue |
766 | 221 | 233 | ||
767 | 222 | if fieldType == 'float': | 234 | if fieldType == 'float': |
768 | 223 | value = '12345.67' | 235 | value = '12345.67' |
769 | 224 | elif fieldType == 'integer': | 236 | elif fieldType == 'integer': |
770 | 225 | 237 | ||
771 | === added directory 'jasper_reports/static' | |||
772 | === added directory 'jasper_reports/static/src' | |||
773 | === added directory 'jasper_reports/static/src/img' | |||
774 | === added file 'jasper_reports/static/src/img/icon.png' | |||
775 | 226 | Binary files jasper_reports/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and jasper_reports/static/src/img/icon.png 2013-06-10 04:33:29 +0000 differ | 238 | Binary files jasper_reports/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and jasper_reports/static/src/img/icon.png 2013-06-10 04:33:29 +0000 differ |
776 | === modified file 'jasper_reports/wizard/jasper_create_data_template.py' | |||
777 | --- jasper_reports/wizard/jasper_create_data_template.py 2012-07-27 12:50:54 +0000 | |||
778 | +++ jasper_reports/wizard/jasper_create_data_template.py 2013-06-10 04:33:29 +0000 | |||
779 | @@ -1,8 +1,47 @@ | |||
782 | 1 | import wizard | 1 | # -*- encoding: utf-8 -*- |
783 | 2 | import pooler | 2 | ############################################################################## |
784 | 3 | # | ||
785 | 4 | # Copyright (c) 2012 Omar Castiñeira Saavedra <omar@pexego.es> | ||
786 | 5 | # Pexego Sistemas Informáticos http://www.pexego.es | ||
787 | 6 | # Copyright (C) 2013 Tadeus Prastowo <tadeus.prastowo@infi-nity.com> | ||
788 | 7 | # Vikasa Infinity Anugrah <http://www.infi-nity.com> | ||
789 | 8 | # | ||
790 | 9 | # WARNING: This program as such is intended to be used by professional | ||
791 | 10 | # programmers who take the whole responsability of assessing all potential | ||
792 | 11 | # consequences resulting from its eventual inadequacies and bugs | ||
793 | 12 | # End users who are looking for a ready-to-use solution with commercial | ||
794 | 13 | # garantees and support are strongly adviced to contract a Free Software | ||
795 | 14 | # Service Company | ||
796 | 15 | # | ||
797 | 16 | # This program is Free Software; you can redistribute it and/or | ||
798 | 17 | # modify it under the terms of the GNU General Public License | ||
799 | 18 | # as published by the Free Software Foundation; either version 2 | ||
800 | 19 | # of the License, or (at your option) any later version. | ||
801 | 20 | # | ||
802 | 21 | # This program is distributed in the hope that it will be useful, | ||
803 | 22 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
804 | 23 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
805 | 24 | # GNU General Public License for more details. | ||
806 | 25 | # | ||
807 | 26 | # You should have received a copy of the GNU General Public License | ||
808 | 27 | # along with this program; if not, write to the Free Software | ||
809 | 28 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
810 | 29 | # | ||
811 | 30 | ############################################################################## | ||
812 | 31 | |||
813 | 3 | import base64 | 32 | import base64 |
816 | 4 | from osv import osv,fields | 33 | |
817 | 5 | from tools.translate import _ | 34 | try: |
818 | 35 | import release | ||
819 | 36 | import pooler | ||
820 | 37 | from osv import osv,fields | ||
821 | 38 | from tools.translate import _ | ||
822 | 39 | except ImportError: | ||
823 | 40 | import openerp | ||
824 | 41 | from openerp import release | ||
825 | 42 | from openerp import pooler | ||
826 | 43 | from openerp.osv import osv,fields | ||
827 | 44 | from openerp.tools.translate import _ | ||
828 | 6 | 45 | ||
829 | 7 | class create_data_template(osv.osv_memory): | 46 | class create_data_template(osv.osv_memory): |
830 | 8 | _name = 'jasper.create.data.template' | 47 | _name = 'jasper.create.data.template' |
831 | @@ -13,7 +52,7 @@ | |||
832 | 13 | model = self.pool.get('ir.model').browse(cr, uid, data['model'][0], context=context) | 52 | model = self.pool.get('ir.model').browse(cr, uid, data['model'][0], context=context) |
833 | 14 | xml = self.pool.get('ir.actions.report.xml').create_xml(cr, uid, model.model, data['depth'], context) | 53 | xml = self.pool.get('ir.actions.report.xml').create_xml(cr, uid, model.model, data['depth'], context) |
834 | 15 | self.write(cr,uid,ids,{ | 54 | self.write(cr,uid,ids,{ |
836 | 16 | 'data' : base64.encodestring( xml ), | 55 | 'data' : base64.encodestring( xml ), |
837 | 17 | 'filename': 'template.xml' | 56 | 'filename': 'template.xml' |
838 | 18 | }) | 57 | }) |
839 | 19 | return True | 58 | return True |
840 | @@ -27,5 +66,5 @@ | |||
841 | 27 | 66 | ||
842 | 28 | _defaults = { | 67 | _defaults = { |
843 | 29 | 'depth': 1 | 68 | 'depth': 1 |
845 | 30 | } | 69 | } |
846 | 31 | create_data_template() | 70 | create_data_template() |
Merged, sorry for delay. Thanks for your contribution.