Skip to content

Commit a0b6040

Browse files
committed
[MIG] report_py3o_fusion_server: Migration to 19.0
1 parent a68eb79 commit a0b6040

9 files changed

Lines changed: 58 additions & 47 deletions

File tree

report_py3o_fusion_server/README.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
15
==========================================
26
Py3o Report Engine - Fusion server support
37
==========================================
@@ -13,17 +17,17 @@ Py3o Report Engine - Fusion server support
1317
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1418
:target: https://odoo-community.org/page/development-status
1519
:alt: Beta
16-
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
20+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
1721
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1822
:alt: License: AGPL-3
1923
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
20-
:target: https://github.com/OCA/reporting-engine/tree/18.0/report_py3o_fusion_server
24+
:target: https://github.com/OCA/reporting-engine/tree/19.0/report_py3o_fusion_server
2125
:alt: OCA/reporting-engine
2226
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/reporting-engine-18-0/reporting-engine-18-0-report_py3o_fusion_server
27+
:target: https://translation.odoo-community.org/projects/reporting-engine-19-0/reporting-engine-19-0-report_py3o_fusion_server
2428
:alt: Translate me on Weblate
2529
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=19.0
2731
:alt: Try me on Runboat
2832

2933
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -178,7 +182,7 @@ Bug Tracker
178182
Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
179183
In case of trouble, please check there if your issue has already been reported.
180184
If you spotted it first, help us to smash it by providing a detailed and welcomed
181-
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_py3o_fusion_server%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
185+
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_py3o_fusion_server%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
182186

183187
Do not contact contributors directly about support or help with technical issues.
184188

@@ -215,6 +219,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
215219
mission is to support the collaborative development of Odoo features and
216220
promote its widespread use.
217221

218-
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/18.0/report_py3o_fusion_server>`_ project on GitHub.
222+
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/19.0/report_py3o_fusion_server>`_ project on GitHub.
219223

220224
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

report_py3o_fusion_server/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "Py3o Report Engine - Fusion server support",
55
"summary": "Let the fusion server handle format conversion.",
6-
"version": "18.0.1.0.0",
6+
"version": "19.0.1.0.0",
77
"category": "Reporting",
88
"license": "AGPL-3",
99
"author": "XCG Consulting,ACSONE SA/NV,Akretion,Odoo Community Association (OCA)",

report_py3o_fusion_server/models/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
33
from . import ir_actions_report
44
from . import py3o_pdf_options
5-
from . import py3o_report
65
from . import py3o_server

report_py3o_fusion_server/models/ir_actions_report.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
44
import logging
55

6-
from odoo import _, api, fields, models
6+
from odoo import api, fields, models
77
from odoo.exceptions import ValidationError
88

99
logger = logging.getLogger(__name__)
@@ -19,7 +19,7 @@ def _check_py3o_server_id(self):
1919
continue
2020
if not report.py3o_is_local_fusion and not report.py3o_server_id:
2121
raise ValidationError(
22-
_(
22+
self.env._(
2323
"You can not use remote fusion without Fusion server. "
2424
"Please specify a Fusion Server"
2525
)
@@ -56,14 +56,12 @@ def _compute_py3o_report_not_available(self):
5656
and not rec.py3o_server_id
5757
):
5858
rec.is_py3o_report_not_available = True
59-
rec.msg_py3o_report_not_available = (
60-
_(
61-
"A fusion server or a libreoffice runtime are required "
62-
"to genereate the py3o report '%s'. If the libreoffice"
63-
"runtime is already installed and is not found by "
64-
"Odoo, you can provide the full path to the runtime by "
65-
"setting the key 'py3o.conversion_command' into the "
66-
"configuration parameters."
67-
)
68-
% rec.name
59+
rec.msg_py3o_report_not_available = self.env._(
60+
"A fusion server or a libreoffice runtime are required "
61+
"to genereate the py3o report '%(report)s'. If the libreoffice"
62+
"runtime is already installed and is not found by "
63+
"Odoo, you can provide the full path to the runtime by "
64+
"setting the key 'py3o.conversion_command' into the "
65+
"configuration parameters.",
66+
report=rec.name,
6967
)

report_py3o_fusion_server/models/py3o_pdf_options.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import logging
66

7-
from odoo import _, api, fields, models
7+
from odoo import api, fields, models
88
from odoo.exceptions import ValidationError
99

1010
logger = logging.getLogger(__name__)
@@ -232,35 +232,35 @@ def check_pdf_options(self):
232232
for opt in self:
233233
if opt.image_jpeg_quality > 100 or opt.image_jpeg_quality < 1:
234234
raise ValidationError(
235-
_(
235+
self.env._(
236236
"The parameter Image JPEG Quality must be between 1 %%"
237-
" and 100 %% (current value: %s %%)"
237+
" and 100 %% (current value: %(val)s %%)",
238+
val=opt.image_jpeg_quality,
238239
)
239-
% opt.image_jpeg_quality
240240
)
241241
if opt.initial_page < 1:
242242
raise ValidationError(
243-
_(
243+
self.env._(
244244
"The initial page parameter must be strictly positive "
245-
"(current value: %d)"
245+
"(current value: %(val)s)",
246+
val=opt.initial_page,
246247
)
247-
% opt.initial_page
248248
)
249249
if opt.pdfa and opt.cross_doc_link_action == "1":
250250
raise ValidationError(
251-
_(
251+
self.env._(
252252
"The PDF/A option is not compatible with "
253253
"'Cross-document Links' = "
254254
"'Open with PDF Reader Application'."
255255
)
256256
)
257257
if opt.magnification == "4" and (opt.zoom < 50 or opt.zoom > 1600):
258258
raise ValidationError(
259-
_(
259+
self.env._(
260260
"The value of the zoom factor must be between 50 and 1600 "
261-
"(current value: %d)"
261+
"(current value: %(val)s)",
262+
val=opt.zoom,
262263
)
263-
% opt.zoom
264264
)
265265

266266
@api.onchange("encrypt")

report_py3o_fusion_server/static/description/index.html

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6-
<title>Py3o Report Engine - Fusion server support</title>
6+
<title>README.rst</title>
77
<style type="text/css">
88

99
/*
@@ -360,16 +360,21 @@
360360
</style>
361361
</head>
362362
<body>
363-
<div class="document" id="py3o-report-engine-fusion-server-support">
364-
<h1 class="title">Py3o Report Engine - Fusion server support</h1>
363+
<div class="document">
365364

365+
366+
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367+
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368+
</a>
369+
<div class="section" id="py3o-report-engine-fusion-server-support">
370+
<h1>Py3o Report Engine - Fusion server support</h1>
366371
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367372
!! This file is generated by oca-gen-addon-readme !!
368373
!! changes will be overwritten. !!
369374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370375
!! source digest: sha256:abe1267ad8b04d3171b35731fe78f8f1fd25c48420962cc8f5096462bb84fb66
371376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/reporting-engine/tree/18.0/report_py3o_fusion_server"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/reporting-engine-18-0/reporting-engine-18-0-report_py3o_fusion_server"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/reporting-engine/tree/19.0/report_py3o_fusion_server"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/reporting-engine-19-0/reporting-engine-19-0-report_py3o_fusion_server"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&amp;target_branch=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373378
<p>This module was written to let a py3o fusion server handle format
374379
conversion instead of local libreoffice. If you install this module
375380
above the <em>report_py3o</em> module, you will have to deploy additionnal
@@ -406,7 +411,7 @@ <h1 class="title">Py3o Report Engine - Fusion server support</h1>
406411
</ul>
407412
</div>
408413
<div class="section" id="installation">
409-
<h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1>
414+
<h2><a class="toc-backref" href="#toc-entry-1">Installation</a></h2>
410415
<p>Install several additional components and Python libs:</p>
411416
<ul class="simple">
412417
<li><a class="reference external" href="https://bitbucket.org/faide/py3o.fusion">Py3o Fusion server</a>,</li>
@@ -486,7 +491,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1>
486491
</pre>
487492
</div>
488493
<div class="section" id="configuration">
489-
<h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1>
494+
<h2><a class="toc-backref" href="#toc-entry-2">Configuration</a></h2>
490495
<p>To configure the PDF export options:</p>
491496
<ol class="arabic simple">
492497
<li>Go to the menu <em>Settings &gt; Technical &gt; Reporting &gt; Py3o &gt; Py3o PDF
@@ -498,32 +503,32 @@ <h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1>
498503
</ol>
499504
</div>
500505
<div class="section" id="known-issues-roadmap">
501-
<h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
506+
<h2><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h2>
502507
<ul class="simple">
503508
<li>Add support for PDF signatures (possible, but no easy because the
504509
signature certificate is a very particular PDF export option)</li>
505510
</ul>
506511
</div>
507512
<div class="section" id="bug-tracker">
508-
<h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
513+
<h2><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h2>
509514
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/reporting-engine/issues">GitHub Issues</a>.
510515
In case of trouble, please check there if your issue has already been reported.
511516
If you spotted it first, help us to smash it by providing a detailed and welcomed
512-
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_py3o_fusion_server%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
517+
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_py3o_fusion_server%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
513518
<p>Do not contact contributors directly about support or help with technical issues.</p>
514519
</div>
515520
<div class="section" id="credits">
516-
<h1><a class="toc-backref" href="#toc-entry-5">Credits</a></h1>
521+
<h2><a class="toc-backref" href="#toc-entry-5">Credits</a></h2>
517522
<div class="section" id="authors">
518-
<h2><a class="toc-backref" href="#toc-entry-6">Authors</a></h2>
523+
<h3><a class="toc-backref" href="#toc-entry-6">Authors</a></h3>
519524
<ul class="simple">
520525
<li>XCG Consulting</li>
521526
<li>ACSONE SA/NV</li>
522527
<li>Akretion</li>
523528
</ul>
524529
</div>
525530
<div class="section" id="contributors">
526-
<h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
531+
<h3><a class="toc-backref" href="#toc-entry-7">Contributors</a></h3>
527532
<ul class="simple">
528533
<li>Florent Aide (<a class="reference external" href="http://odoo.consulting/">XCG Consulting</a>)</li>
529534
<li>Laurent Mignon &lt;<a class="reference external" href="mailto:laurent.mignon&#64;acsone.eu">laurent.mignon&#64;acsone.eu</a>&gt;,</li>
@@ -534,18 +539,19 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
534539
</ul>
535540
</div>
536541
<div class="section" id="maintainers">
537-
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
542+
<h3><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h3>
538543
<p>This module is maintained by the OCA.</p>
539544
<a class="reference external image-reference" href="https://odoo-community.org">
540545
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
541546
</a>
542547
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
543548
mission is to support the collaborative development of Odoo features and
544549
promote its widespread use.</p>
545-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/18.0/report_py3o_fusion_server">OCA/reporting-engine</a> project on GitHub.</p>
550+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/19.0/report_py3o_fusion_server">OCA/reporting-engine</a> project on GitHub.</p>
546551
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
547552
</div>
548553
</div>
549554
</div>
555+
</div>
550556
</body>
551557
</html>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Copyright 2017 Therp BV <http://therp.nl>
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
from . import py3o_report

report_py3o_fusion_server/models/py3o_report.py renamed to report_py3o_fusion_server/wizard/py3o_report.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import requests
1414

15-
from odoo import _, models
15+
from odoo import models
1616
from odoo.exceptions import UserError
1717

1818
logger = logging.getLogger(__name__)
@@ -87,7 +87,7 @@ def _create_single_report(self, model_instance, data):
8787
if r.status_code != 200:
8888
# server says we have an issue... let's tell that to enduser
8989
logger.error("Py3o fusion server error: %s", r.text)
90-
raise UserError(_("Fusion server error %s") % r.text)
90+
raise UserError(self.env._("Fusion server error %(error)s", error=r.text))
9191

9292
chunk_size = 1024
9393
with open(result_path, "w+b") as fd:

test-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
openpyxl
2+
git+https://github.com/kopeyev/[email protected]_py3o#subdirectory=report_py3o

0 commit comments

Comments
 (0)