report_async: Pre-Commit
parent
a618b05461
commit
feb9f2b953
|
@ -14,13 +14,13 @@ Report Async
|
|||
: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/14.0/report_async
|
||||
:target: https://github.com/OCA/reporting-engine/tree/15.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-14-0/reporting-engine-14-0-report_async
|
||||
:target: https://translation.odoo-community.org/projects/reporting-engine-15-0/reporting-engine-15-0-report_async
|
||||
:alt: Translate me on Weblate
|
||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
||||
:target: https://runbot.odoo-community.org/runbot/143/14.0
|
||||
:target: https://runbot.odoo-community.org/runbot/143/15.0
|
||||
:alt: Try me on Runbot
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
@ -76,7 +76,7 @@ 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 smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_async%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_async%0Aversion:%2015.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.
|
||||
|
||||
|
@ -118,6 +118,6 @@ 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/14.0/report_async>`_ project on GitHub.
|
||||
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/15.0/report_async>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{
|
||||
"name": "Report Async",
|
||||
"summary": "Central place to run reports live or async",
|
||||
"version": "14.0.1.0.0",
|
||||
"version": "15.0.1.0.0",
|
||||
"author": "Ecosoft, Odoo Community Association (OCA)",
|
||||
"license": "AGPL-3",
|
||||
"website": "https://github.com/OCA/reporting-engine",
|
||||
|
|
|
@ -1,72 +1,69 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<data 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>
|
||||
<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>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</field>
|
||||
<field name="auto_delete" eval="True" />
|
||||
</record>
|
||||
</data>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</field>
|
||||
<field name="auto_delete" eval="True" />
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
|
@ -28,7 +28,6 @@ class ReportAsync(models.Model):
|
|||
required=True,
|
||||
)
|
||||
allow_async = fields.Boolean(
|
||||
string="Allow Async",
|
||||
default=False,
|
||||
help="This is not automatic field, please check if you want to allow "
|
||||
"this report in background process",
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
|
||||
<title>Report Async</title>
|
||||
<style type="text/css">
|
||||
|
||||
|
@ -367,7 +367,7 @@ ul.auto-toc {
|
|||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" 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" 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" href="https://github.com/OCA/reporting-engine/tree/14.0/report_async"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-0-report_async"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/143/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p><a class="reference external" 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" 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" href="https://github.com/OCA/reporting-engine/tree/15.0/report_async"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/reporting-engine-15-0/reporting-engine-15-0-report_async"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/143/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p>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,</p>
|
||||
<ol class="arabic simple">
|
||||
|
@ -424,7 +424,7 @@ report will be sent.</li>
|
|||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/reporting-engine/issues">GitHub Issues</a>.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_async%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_async%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
|
@ -455,7 +455,7 @@ mission is to support the collaborative development of Odoo features and
|
|||
promote its widespread use.</p>
|
||||
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
|
||||
<p><a class="reference external" href="https://github.com/kittiu"><img alt="kittiu" src="https://github.com/kittiu.png?size=40px" /></a></p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/14.0/report_async">OCA/reporting-engine</a> project on GitHub.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/15.0/report_async">OCA/reporting-engine</a> project on GitHub.</p>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -19,7 +19,11 @@ class TestJobChannel(common.TransactionCase):
|
|||
"active_id": self.print_doc.id,
|
||||
}
|
||||
ctx.update(res["context"])
|
||||
with Form(obj.with_context(ctx)) as form:
|
||||
with Form(
|
||||
obj.with_context(
|
||||
active_model=self.print_doc._name, active_id=self.print_doc.id
|
||||
)
|
||||
) as form:
|
||||
form.reference = "{},{}".format(self.test_rec._name, self.test_rec.id)
|
||||
form.action_report_id = self.test_rpt
|
||||
print_wizard = form.save()
|
||||
|
@ -29,7 +33,7 @@ class TestJobChannel(common.TransactionCase):
|
|||
"""Run now will return report action as normal"""
|
||||
res = self.print_doc.run_now()
|
||||
report_action = self._print_wizard(res).print_report()
|
||||
self.assertEquals(report_action["type"], "ir.actions.report")
|
||||
self.assertEqual(report_action["type"], "ir.actions.report")
|
||||
|
||||
def test_2_run_async(self):
|
||||
"""Run background will return nothing, job started"""
|
||||
|
@ -39,8 +43,8 @@ class TestJobChannel(common.TransactionCase):
|
|||
res = self.print_doc.run_async()
|
||||
print_wizard = self._print_wizard(res)
|
||||
report_action = print_wizard.print_report()
|
||||
self.assertEquals(report_action, {}) # Do not run report yet
|
||||
self.assertEquals(self.print_doc.job_status, "pending") # Job started
|
||||
self.assertEqual(report_action, {}) # Do not run report yet
|
||||
self.assertEqual(self.print_doc.job_status, "pending") # Job started
|
||||
# Test produce file (as queue will not run in test mode)
|
||||
docids = [print_wizard.reference.id]
|
||||
data = None
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<field name="name">report.async.tree</field>
|
||||
<field name="model">report.async</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Report Center">
|
||||
<tree>
|
||||
<field name="action_id" context="{'access_sudo': True}" />
|
||||
<button type="object" name="run_now" string="Run Now" icon="fa-bolt" />
|
||||
<button
|
||||
|
|
Loading…
Reference in New Issue