Skip to content

Commit 21310d5

Browse files
sakthi-shanatchuthan
authored andcommitted
[IMP] report_async: pre-commit auto fixes
1 parent ae6b4cc commit 21310d5

12 files changed

+133
-104
lines changed

report_async/README.rst

+44-35
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,35 @@ Report Async
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/16.0/report_async
20+
:target: https://github.com/OCA/reporting-engine/tree/17.0/report_async
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-16-0/reporting-engine-16-0-report_async
23+
:target: https://translation.odoo-community.org/projects/reporting-engine-17-0/reporting-engine-17-0-report_async
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=16.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=17.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
3030

31-
The new menu "Report Center" is the central place to host your reports in one place.
32-
From here, there are 2 ways to launch the report,
31+
The new menu "Report Center" is the central place to host your reports
32+
in one place. From here, there are 2 ways to launch the report,
3333

3434
1. Run Now - run report immediately as per normal.
3535
2. Run Background - put the report execution to queue job.
3636

37-
By using the queue job, option 2 is great for long running report.
38-
The report file will be saved for later use, with the option to send report
37+
By using the queue job, option 2 is great for long running report. The
38+
report file will be saved for later use, with the option to send report
3939
by email as soon as it is ready.
4040

4141
Notes:
4242

43-
* Only user with Technical Feature rights can manage the report.
44-
* Every internal user will have right to execute the report allowed for his/her groups.
45-
* The files created are owned and viewable only by the person who run the report.
46-
* Job queue manager can also see all jobs for each reports.
43+
- Only user with Technical Feature rights can manage the report.
44+
- Every internal user will have right to execute the report allowed for
45+
his/her groups.
46+
- The files created are owned and viewable only by the person who run
47+
the report.
48+
- Job queue manager can also see all jobs for each reports.
4749

4850
**Table of contents**
4951

@@ -57,56 +59,63 @@ Menu: Dashboard > Report Center
5759

5860
As Technical Feature users, you can manage reports for Report Center.
5961

60-
- **Report:** choose the report (a window action). Although the option show all window actions
61-
it only make sense for window actions that launch reports.
62-
- **Allow Async:** check this, if you want the report to run in background too, suitable for
63-
report that return file as result, i.e., pdf/xlsx/csv/txt.
64-
- **Email Notification:** if checked, once the background process is completed, email with link to download
65-
report will be sent.
66-
- **Groups:** select user groups allowed to use this report. If left blank, all user can use.
62+
- **Report:** choose the report (a window action). Although the option
63+
show all window actions it only make sense for window actions that
64+
launch reports.
65+
- **Allow Async:** check this, if you want the report to run in
66+
background too, suitable for report that return file as result, i.e.,
67+
pdf/xlsx/csv/txt.
68+
- **Email Notification:** if checked, once the background process is
69+
completed, email with link to download report will be sent.
70+
- **Groups:** select user groups allowed to use this report. If left
71+
blank, all user can use.
6772

6873
As normal user, you can run your reports from Report Center
6974

70-
- **Run Now button:** to run report immediately as per normal.
71-
- **Run Background button:** to run report asynchronously. Fall back to run now, if not report that produce file.
72-
- **Job Status:** show status of the latest run job. If job fail, exception error will also shown
73-
- **Files:** show all files being produced by the job as run by the user.
74-
- **Jobs:** show all jobs triggered by this report as run by the user. Only job queue manager have access to this button.
75+
- **Run Now button:** to run report immediately as per normal.
76+
- **Run Background button:** to run report asynchronously. Fall back to
77+
run now, if not report that produce file.
78+
- **Job Status:** show status of the latest run job. If job fail,
79+
exception error will also shown
80+
- **Files:** show all files being produced by the job as run by the
81+
user.
82+
- **Jobs:** show all jobs triggered by this report as run by the user.
83+
Only job queue manager have access to this button.
7584

7685
Bug Tracker
7786
===========
7887

7988
Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
8089
In case of trouble, please check there if your issue has already been reported.
8190
If you spotted it first, help us to smash it by providing a detailed and welcomed
82-
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_async%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
91+
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_async%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
8392

8493
Do not contact contributors directly about support or help with technical issues.
8594

8695
Credits
8796
=======
8897

8998
Authors
90-
~~~~~~~
99+
-------
91100

92101
* Ecosoft
93102

94103
Contributors
95-
~~~~~~~~~~~~
104+
------------
96105

97-
* `Ecosoft <http://ecosoft.co.th>`__:
106+
- `Ecosoft <http://ecosoft.co.th>`__:
98107

99-
* Kitti U. <[email protected]>
100-
* Saran Lim. <[email protected]>
101-
* Tharathip Chaweewongphan <[email protected]>
108+
- Kitti U. <[email protected]>
109+
- Saran Lim. <[email protected]>
110+
- Tharathip Chaweewongphan <[email protected]>
102111

103-
* Opensourceintegrators
112+
- Opensourceintegrators
104113

105-
* Daniel Reis <[email protected]>
106-
* Nikul Chaudhary <[email protected]>
114+
- Daniel Reis <[email protected]>
115+
- Nikul Chaudhary <[email protected]>
107116

108117
Maintainers
109-
~~~~~~~~~~~
118+
-----------
110119

111120
This module is maintained by the OCA.
112121

@@ -126,6 +135,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
126135

127136
|maintainer-kittiu|
128137

129-
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/16.0/report_async>`_ project on GitHub.
138+
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/17.0/report_async>`_ project on GitHub.
130139

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

report_async/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "Report Async",
55
"summary": "Central place to run reports live or async",
6-
"version": "16.0.1.0.0",
6+
"version": "17.0.1.0.0",
77
"author": "Ecosoft, Odoo Community Association (OCA)",
88
"license": "AGPL-3",
99
"website": "https://github.com/OCA/reporting-engine",

report_async/models/ir_report.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Report(models.Model):
1111
_inherit = "ir.actions.report"
1212

1313
def report_action(self, docids, data=None, config=True):
14-
res = super(Report, self).report_action(docids, data=data, config=config)
14+
res = super().report_action(docids, data=data, config=config)
1515
if res["context"].get("async_process", False):
1616
rpt_async_id = res["context"]["active_id"]
1717
report_async = self.env["report.async"].browse(rpt_async_id)

report_async/models/report_async.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def _compute_file(self):
9898
order="id desc",
9999
)
100100
for rec in self:
101-
rec.file_ids = files.filtered(lambda l: l.res_id == rec.id)
101+
rec.file_ids = files.filtered(lambda file, rec=rec: file.res_id == rec.id)
102102

103103
def run_now(self):
104104
self.ensure_one()
@@ -142,7 +142,7 @@ def run_report(self, docids, data, report_id, user_id):
142142
# Run report
143143
out_file, file_ext = getattr(report, func)(report.xml_id, docids, data)
144144
out_file = base64.b64encode(out_file)
145-
out_name = "{}.{}".format(report.name, file_ext)
145+
out_name = f"{report.name}.{file_ext}"
146146
# Save report to attachment
147147
attachment = (
148148
self.env["ir.attachment"]

report_async/pyproject.toml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"

report_async/readme/CONTRIBUTORS.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- [Ecosoft](http://ecosoft.co.th):
2+
- Kitti U. \<<[email protected]>\>
3+
- Saran Lim. \<<[email protected]>\>
4+
- Tharathip Chaweewongphan \<<[email protected]>\>
5+
- Opensourceintegrators
6+
- Daniel Reis \<<[email protected]>\>
7+
- Nikul Chaudhary \<<[email protected]>\>

report_async/readme/CONTRIBUTORS.rst

-10
This file was deleted.

report_async/readme/DESCRIPTION.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
The new menu "Report Center" is the central place to host your reports
2+
in one place. From here, there are 2 ways to launch the report,
3+
4+
1. Run Now - run report immediately as per normal.
5+
2. Run Background - put the report execution to queue job.
6+
7+
By using the queue job, option 2 is great for long running report. The
8+
report file will be saved for later use, with the option to send report
9+
by email as soon as it is ready.
10+
11+
Notes:
12+
13+
- Only user with Technical Feature rights can manage the report.
14+
- Every internal user will have right to execute the report allowed for
15+
his/her groups.
16+
- The files created are owned and viewable only by the person who run
17+
the report.
18+
- Job queue manager can also see all jobs for each reports.

report_async/readme/DESCRIPTION.rst

-16
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
1-
Menu: Dashboard > Report Center
1+
Menu: Dashboard \> Report Center
22

33
As Technical Feature users, you can manage reports for Report Center.
44

5-
- **Report:** choose the report (a window action). Although the option show all window actions
6-
it only make sense for window actions that launch reports.
7-
- **Allow Async:** check this, if you want the report to run in background too, suitable for
8-
report that return file as result, i.e., pdf/xlsx/csv/txt.
9-
- **Email Notification:** if checked, once the background process is completed, email with link to download
10-
report will be sent.
11-
- **Groups:** select user groups allowed to use this report. If left blank, all user can use.
5+
- **Report:** choose the report (a window action). Although the option
6+
show all window actions it only make sense for window actions that
7+
launch reports.
8+
- **Allow Async:** check this, if you want the report to run in
9+
background too, suitable for report that return file as result, i.e.,
10+
pdf/xlsx/csv/txt.
11+
- **Email Notification:** if checked, once the background process is
12+
completed, email with link to download report will be sent.
13+
- **Groups:** select user groups allowed to use this report. If left
14+
blank, all user can use.
1215

1316
As normal user, you can run your reports from Report Center
1417

1518
- **Run Now button:** to run report immediately as per normal.
16-
- **Run Background button:** to run report asynchronously. Fall back to run now, if not report that produce file.
17-
- **Job Status:** show status of the latest run job. If job fail, exception error will also shown
18-
- **Files:** show all files being produced by the job as run by the user.
19-
- **Jobs:** show all jobs triggered by this report as run by the user. Only job queue manager have access to this button.
19+
- **Run Background button:** to run report asynchronously. Fall back to
20+
run now, if not report that produce file.
21+
- **Job Status:** show status of the latest run job. If job fail,
22+
exception error will also shown
23+
- **Files:** show all files being produced by the job as run by the
24+
user.
25+
- **Jobs:** show all jobs triggered by this report as run by the user.
26+
Only job queue manager have access to this button.

0 commit comments

Comments
 (0)