Skip to content

Commit 09578b8

Browse files
committed
Merge PR #878 into 17.0
Signed-off-by HviorForgeFlow
2 parents 2476e58 + efcecf0 commit 09578b8

27 files changed

+2510
-0
lines changed

report_async/README.rst

+140
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
============
2+
Report Async
3+
============
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:49866d2b712288add9819deb8ff6dc8aa180a52463a72789350974bbf10e17ae
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |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_async
21+
:alt: OCA/reporting-engine
22+
.. |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_async
24+
:alt: Translate me on Weblate
25+
.. |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
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
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,
33+
34+
1. Run Now - run report immediately as per normal.
35+
2. Run Background - put the report execution to queue job.
36+
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
39+
by email as soon as it is ready.
40+
41+
Notes:
42+
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.
49+
50+
**Table of contents**
51+
52+
.. contents::
53+
:local:
54+
55+
Usage
56+
=====
57+
58+
Menu: Dashboard > Report Center
59+
60+
As Technical Feature users, you can manage reports for Report Center.
61+
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.
72+
73+
As normal user, you can run your reports from Report Center
74+
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.
84+
85+
Bug Tracker
86+
===========
87+
88+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
89+
In case of trouble, please check there if your issue has already been reported.
90+
If you spotted it first, help us to smash it by providing a detailed and welcomed
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**>`_.
92+
93+
Do not contact contributors directly about support or help with technical issues.
94+
95+
Credits
96+
=======
97+
98+
Authors
99+
-------
100+
101+
* Ecosoft
102+
103+
Contributors
104+
------------
105+
106+
- `Ecosoft <http://ecosoft.co.th>`__:
107+
108+
- Kitti U. <[email protected]>
109+
- Saran Lim. <[email protected]>
110+
- Tharathip Chaweewongphan <[email protected]>
111+
112+
- Opensourceintegrators
113+
114+
- Daniel Reis <[email protected]>
115+
- Nikul Chaudhary <[email protected]>
116+
117+
Maintainers
118+
-----------
119+
120+
This module is maintained by the OCA.
121+
122+
.. image:: https://odoo-community.org/logo.png
123+
:alt: Odoo Community Association
124+
:target: https://odoo-community.org
125+
126+
OCA, or the Odoo Community Association, is a nonprofit organization whose
127+
mission is to support the collaborative development of Odoo features and
128+
promote its widespread use.
129+
130+
.. |maintainer-kittiu| image:: https://github.com/kittiu.png?size=40px
131+
:target: https://github.com/kittiu
132+
:alt: kittiu
133+
134+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
135+
136+
|maintainer-kittiu|
137+
138+
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/17.0/report_async>`_ project on GitHub.
139+
140+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

report_async/__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
3+
4+
from . import models
5+
from . import wizard

report_async/__manifest__.py

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
3+
{
4+
"name": "Report Async",
5+
"summary": "Central place to run reports live or async",
6+
"version": "17.0.1.0.0",
7+
"author": "Ecosoft, Odoo Community Association (OCA)",
8+
"license": "AGPL-3",
9+
"website": "https://github.com/OCA/reporting-engine",
10+
"category": "Generic Modules",
11+
"depends": ["queue_job", "spreadsheet_dashboard"],
12+
"data": [
13+
"security/ir.model.access.csv",
14+
"security/ir_rule.xml",
15+
"data/mail_template.xml",
16+
"data/queue_job_function_data.xml",
17+
"views/report_async.xml",
18+
"wizard/print_report_wizard.xml",
19+
],
20+
"demo": ["demo/report_async_demo.xml"],
21+
"installable": True,
22+
"maintainers": ["kittiu"],
23+
"development_status": "Beta",
24+
}

report_async/data/mail_template.xml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<odoo noupdate="1">
2+
<record id="async_report_delivery" model="mail.template">
3+
<field name="name">Report Async: New Report Available</field>
4+
<field name="model_id" ref="base.model_ir_attachment" />
5+
<field name="subject">Your report is available, ${object.name}</field>
6+
<field
7+
name="email_from"
8+
>${object.company_id.partner_id.email_formatted|safe}</field>
9+
<field name="partner_to">{{ user.partner_id.id }}</field>
10+
<field name="body_html" type="html">
11+
<table
12+
border="0"
13+
cellpadding="0"
14+
cellspacing="0"
15+
style="background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"
16+
>
17+
<tr>
18+
<td align="center">
19+
<table
20+
border="0"
21+
cellpadding="0"
22+
cellspacing="0"
23+
width="590"
24+
style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;"
25+
>
26+
<tbody>
27+
<tr>
28+
<td align="center" style="min-width: 590px;">
29+
<table
30+
border="0"
31+
cellpadding="0"
32+
cellspacing="0"
33+
width="590"
34+
style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;"
35+
>
36+
<tr>
37+
<td
38+
valign="top"
39+
style="font-size: 13px;"
40+
>
41+
% set base_url = object.env['ir.config_parameter'].sudo().get_param('web.base.url')
42+
% set download_url = '%s/web/content/ir.attachment/%s/datas/%s?download=true' % (base_url, object.id, object.name, )
43+
<div>
44+
Dear ${object.create_uid.partner_id.name or ''},
45+
<br /><br />
46+
Your requested report, ${object.name}, is available for <b
47+
>
48+
<a
49+
href='${download_url}'
50+
>download</a>
51+
</b>.
52+
<br /><br />
53+
Have a nice day!<br />
54+
--<br />${object.company_id.name}
55+
</div>
56+
</td>
57+
</tr>
58+
</table>
59+
</td>
60+
</tr>
61+
</tbody>
62+
</table>
63+
</td>
64+
</tr>
65+
</table>
66+
</field>
67+
<field name="auto_delete" eval="True" />
68+
</record>
69+
</odoo>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<odoo noupdate="1">
2+
<record id="job_function_report_async_run_report" model="queue.job.function">
3+
<field name="model_id" ref="report_async.model_report_async" />
4+
<field name="method">run_report</field>
5+
</record>
6+
</odoo>
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<odoo>
3+
<record id="report_async_print_document" model="report.async">
4+
<field name="action_id" eval="ref('report_async.action_print_report_wizard')" />
5+
<field name="allow_async" eval="0" />
6+
</record>
7+
</odoo>

0 commit comments

Comments
 (0)