Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] report_async: Migration to 17.0 #878

Merged
merged 25 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 140 additions & 0 deletions report_async/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
============
Report Async
============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:49866d2b712288add9819deb8ff6dc8aa180a52463a72789350974bbf10e17ae
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
:target: https://github.com/OCA/reporting-engine/tree/17.0/report_async
:alt: OCA/reporting-engine
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/reporting-engine-17-0/reporting-engine-17-0-report_async
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

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

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

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

Notes:

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

**Table of contents**

.. contents::
:local:

Usage
=====

Menu: Dashboard > Report Center

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

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

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

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

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`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**>`_.

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

Credits
=======

Authors
-------

* Ecosoft

Contributors
------------

- `Ecosoft <http://ecosoft.co.th>`__:

- Kitti U. <[email protected]>
- Saran Lim. <[email protected]>
- Tharathip Chaweewongphan <[email protected]>

- Opensourceintegrators

- Daniel Reis <[email protected]>
- Nikul Chaudhary <[email protected]>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-kittiu| image:: https://github.com/kittiu.png?size=40px
:target: https://github.com/kittiu
:alt: kittiu

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-kittiu|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions report_async/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)

from . import models
from . import wizard
24 changes: 24 additions & 0 deletions report_async/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
{
"name": "Report Async",
"summary": "Central place to run reports live or async",
"version": "17.0.1.0.0",
"author": "Ecosoft, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/reporting-engine",
"category": "Generic Modules",
"depends": ["queue_job", "spreadsheet_dashboard"],
"data": [
"security/ir.model.access.csv",
"security/ir_rule.xml",
"data/mail_template.xml",
"data/queue_job_function_data.xml",
"views/report_async.xml",
"wizard/print_report_wizard.xml",
],
"demo": ["demo/report_async_demo.xml"],
"installable": True,
"maintainers": ["kittiu"],
"development_status": "Beta",
}
69 changes: 69 additions & 0 deletions report_async/data/mail_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<odoo noupdate="1">
<record id="async_report_delivery" model="mail.template">
<field name="name">Report Async: New Report Available</field>
<field name="model_id" ref="base.model_ir_attachment" />
<field name="subject">Your report is available, ${object.name}</field>
<field
name="email_from"
>${object.company_id.partner_id.email_formatted|safe}</field>
<field name="partner_to">{{ user.partner_id.id }}</field>
<field name="body_html" type="html">
<table
border="0"
cellpadding="0"
cellspacing="0"
style="background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"
>
<tr>
<td align="center">
<table
border="0"
cellpadding="0"
cellspacing="0"
width="590"
style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;"
>
<tbody>
<tr>
<td align="center" style="min-width: 590px;">
<table
border="0"
cellpadding="0"
cellspacing="0"
width="590"
style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;"
>
<tr>
<td
valign="top"
style="font-size: 13px;"
>
% set base_url = object.env['ir.config_parameter'].sudo().get_param('web.base.url')
% set download_url = '%s/web/content/ir.attachment/%s/datas/%s?download=true' % (base_url, object.id, object.name, )
<div>
Dear ${object.create_uid.partner_id.name or ''},
<br /><br />
Your requested report, ${object.name}, is available for <b
>
<a
href='${download_url}'
>download</a>
</b>.
<br /><br />
Have a nice day!<br />
--<br />${object.company_id.name}
</div>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</field>
<field name="auto_delete" eval="True" />
</record>
</odoo>
6 changes: 6 additions & 0 deletions report_async/data/queue_job_function_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<odoo noupdate="1">
<record id="job_function_report_async_run_report" model="queue.job.function">
<field name="model_id" ref="report_async.model_report_async" />
<field name="method">run_report</field>
</record>
</odoo>
7 changes: 7 additions & 0 deletions report_async/demo/report_async_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="report_async_print_document" model="report.async">
<field name="action_id" eval="ref('report_async.action_print_report_wizard')" />
<field name="allow_async" eval="0" />
</record>
</odoo>
Loading
Loading