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