Skip to content

Commit 8e13d2b

Browse files
Lukas TranLukas Tran
Lukas Tran
authored and
Lukas Tran
committed
[MIG] migrate report_wkhtmltopdf_param to 18.0
1 parent dc0e880 commit 8e13d2b

File tree

8 files changed

+38
-27
lines changed

8 files changed

+38
-27
lines changed

report_wkhtmltopdf_param/README.rst

+12-11
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Report Wkhtmltopdf Param
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
20-
:target: https://github.com/OCA/reporting-engine/tree/17.0/report_wkhtmltopdf_param
20+
:target: https://github.com/OCA/reporting-engine/tree/18.0/report_wkhtmltopdf_param
2121
:alt: OCA/reporting-engine
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/reporting-engine-17-0/reporting-engine-17-0-report_wkhtmltopdf_param
23+
:target: https://translation.odoo-community.org/projects/reporting-engine-18-0/reporting-engine-18-0-report_wkhtmltopdf_param
2424
:alt: Translate me on Weblate
2525
.. |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=17.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=18.0
2727
:alt: Try me on Runboat
2828

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

6464
Do not contact contributors directly about support or help with technical issues.
6565

@@ -75,13 +75,14 @@ Authors
7575
Contributors
7676
------------
7777

78-
- Miku Laitinen <miku@avoin.systems>
79-
- Jordi Ballester <jordi.ballester@eficent.com>
80-
- Saran Lim. <saranl@ecosoft.co.th>
81-
- Foram Shah <foramshah@initos.com>
82-
- `Trobz <https://www.trobz.com>`__:
78+
- Miku Laitinen <miku@avoin.systems>
79+
- Jordi Ballester <jordi.ballester@eficent.com>
80+
- Saran Lim. <saranl@ecosoft.co.th>
81+
- Foram Shah <foramshah@initos.com>
82+
- `Trobz <https://www.trobz.com>`__:
8383

84-
- Tris Doan <tridm@trobz.com>
84+
- Tris Doan <tridm@trobz.com>
85+
- Nhan Tran <nhant@trobz.com>
8586

8687
Other credits
8788
-------------
@@ -102,6 +103,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
102103
mission is to support the collaborative development of Odoo features and
103104
promote its widespread use.
104105

105-
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/17.0/report_wkhtmltopdf_param>`_ project on GitHub.
106+
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/18.0/report_wkhtmltopdf_param>`_ project on GitHub.
106107

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

report_wkhtmltopdf_param/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# noinspection PyStatementEffect
55
{
66
"name": "Report Wkhtmltopdf Param",
7-
"version": "17.0.1.0.0",
7+
"version": "18.0.1.0.0",
88
"license": "AGPL-3",
99
"summary": """
1010
Add new parameters for a paper format to be used by wkhtmltopdf

report_wkhtmltopdf_param/models/report_paperformat.py

+4-4
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__)
@@ -21,7 +21,7 @@ class Paper(models.Model):
2121
)
2222

2323
@api.constrains("custom_params")
24-
def _check_recursion(self):
24+
def _check_recursion_custom_params(self):
2525
for paperformat in self:
2626
sample_html = """
2727
<!DOCTYPE html>
@@ -36,8 +36,8 @@ def _check_recursion(self):
3636
report = self.env["ir.actions.report"].new(
3737
{"paperformat_id": paperformat.id}
3838
)
39-
content = report._run_wkhtmltopdf(sample_html)
39+
content = report._run_wkhtmltopdf([sample_html])
4040
if not content:
4141
raise ValidationError(
42-
_("Failed to create a PDF using the provided parameters.")
42+
self.env._("Failed to create a PDF using the provided parameters.")
4343
)

report_wkhtmltopdf_param/readme/CONTRIBUTORS.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
- Foram Shah \<<foramshah@initos.com>\>
55
- [Trobz](https://www.trobz.com):
66
- Tris Doan \<<tridm@trobz.com>\>
7+
- Nhan Tran \<<nhant@trobz.com>\>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
22
"paperformat_parameter_access_portal","ir_actions_report_paperformat_parameter group_portal","model_report_paperformat_parameter","base.group_portal",1,0,0,0
3-
"paperformat_parameter_access_employee","ir_actions_report_paperformat_parameter group_hr_user","model_report_paperformat_parameter",,1,0,1,0
3+
"paperformat_parameter_access_employee","ir_actions_report_paperformat_parameter group_hr_user","model_report_paperformat_parameter",base.group_user,1,0,1,0
44
"paperformat_parameter_access_administration","ir_actions_report_paperformat_parameter group_system","model_report_paperformat_parameter","base.group_system",1,1,1,1

report_wkhtmltopdf_param/static/description/index.html

+11-7
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
/*
1010
:Author: David Goodger (goodger@python.org)
11-
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
11+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
1212
:Copyright: This stylesheet has been placed in the public domain.
1313
1414
Default cascading style sheet for the HTML output of Docutils.
15+
Despite the name, some widely supported CSS2 features are used.
1516
1617
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1718
customize this style sheet.
@@ -274,7 +275,7 @@
274275
margin-left: 2em ;
275276
margin-right: 2em }
276277

277-
pre.code .ln { color: grey; } /* line numbers */
278+
pre.code .ln { color: gray; } /* line numbers */
278279
pre.code, code { background-color: #eeeeee }
279280
pre.code .comment, code .comment { color: #5C6576 }
280281
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -300,7 +301,7 @@
300301
span.pre {
301302
white-space: pre }
302303

303-
span.problematic {
304+
span.problematic, pre.problematic {
304305
color: red }
305306

306307
span.section-subtitle {
@@ -368,7 +369,7 @@ <h1 class="title">Report Wkhtmltopdf Param</h1>
368369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
369370
!! source digest: sha256:59a736539b5a1aed58f6c0a874c94500c4974f286fbb5cb3d45eddcc2e2865f5
370371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
371-
<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/17.0/report_wkhtmltopdf_param"><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-17-0/reporting-engine-17-0-report_wkhtmltopdf_param"><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=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
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_wkhtmltopdf_param"><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_wkhtmltopdf_param"><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>
372373
<p>This module allows you to add new parameters for a paper format which
373374
are then forwarded to wkhtmltopdf command as arguments. To display the
374375
arguments that wkhtmltopdf accepts go to your command line and type
@@ -407,7 +408,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
407408
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/reporting-engine/issues">GitHub Issues</a>.
408409
In case of trouble, please check there if your issue has already been reported.
409410
If you spotted it first, help us to smash it by providing a detailed and welcomed
410-
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_wkhtmltopdf_param%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
411+
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_wkhtmltopdf_param%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
411412
<p>Do not contact contributors directly about support or help with technical issues.</p>
412413
</div>
413414
<div class="section" id="credits">
@@ -428,6 +429,7 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
428429
<li>Foram Shah &lt;<a class="reference external" href="mailto:foramshah&#64;initos.com">foramshah&#64;initos.com</a>&gt;</li>
429430
<li><a class="reference external" href="https://www.trobz.com">Trobz</a>:<ul>
430431
<li>Tris Doan &lt;<a class="reference external" href="mailto:tridm&#64;trobz.com">tridm&#64;trobz.com</a>&gt;</li>
432+
<li>Nhan Tran &lt;<a class="reference external" href="mailto:nhant&#64;trobz.com">nhant&#64;trobz.com</a>&gt;</li>
431433
</ul>
432434
</li>
433435
</ul>
@@ -440,11 +442,13 @@ <h2><a class="toc-backref" href="#toc-entry-6">Other credits</a></h2>
440442
<div class="section" id="maintainers">
441443
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
442444
<p>This module is maintained by the OCA.</p>
443-
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
445+
<a class="reference external image-reference" href="https://odoo-community.org">
446+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
447+
</a>
444448
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
445449
mission is to support the collaborative development of Odoo features and
446450
promote its widespread use.</p>
447-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/17.0/report_wkhtmltopdf_param">OCA/reporting-engine</a> project on GitHub.</p>
451+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/18.0/report_wkhtmltopdf_param">OCA/reporting-engine</a> project on GitHub.</p>
448452
<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>
449453
</div>
450454
</div>

report_wkhtmltopdf_param/tests/test_report_paperformat.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Copyright 2017 Eficent Business and IT Consulting Services, S.L.
33
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
44

5+
import logging
6+
57
import odoo.tests
68
from odoo.exceptions import ValidationError
79
from odoo.tests.common import tagged
@@ -11,7 +13,10 @@
1113
class TestWkhtmltopdf(odoo.tests.TransactionCase):
1214
def test_wkhtmltopdf_incorrect_parameter(self):
1315
for report_paperformat in self.env["report.paperformat"].search([]):
14-
with self.assertRaises(ValidationError):
16+
with (
17+
self.assertRaises(ValidationError),
18+
self.assertLogs(level=logging.WARNING),
19+
):
1520
report_paperformat.update(
1621
{"custom_params": [(0, 0, {"name": "bad-parameter"})]}
1722
)

report_wkhtmltopdf_param/views/paperformat.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
<field name="arch" type="xml">
99
<field name="report_ids" position="after">
1010
<field name="custom_params">
11-
<tree editable="bottom">
11+
<list editable="bottom">
1212
<field name="name" />
1313
<field name="value" />
14-
</tree>
14+
</list>
1515
</field>
1616
</field>
1717
</field>

0 commit comments

Comments
 (0)