Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ Available addons
----------------
addon | version | maintainers | summary
--- | --- | --- | ---
[base_export_async](base_export_async/) | 16.0.1.1.0 | | Asynchronous export with job queue
[base_export_async](base_export_async/) | 16.0.1.2.0 | | Asynchronous export with job queue
[base_import_async](base_import_async/) | 16.0.1.2.0 | | Import CSV files in the background
[queue_job](queue_job/) | 16.0.2.11.5 | <a href='https://github.com/guewen'><img src='https://github.com/guewen.png' width='32' height='32' style='border-radius:50%;' alt='guewen'/></a> | Job Queue
[queue_job](queue_job/) | 16.0.2.12.0 | <a href='https://github.com/guewen'><img src='https://github.com/guewen.png' width='32' height='32' style='border-radius:50%;' alt='guewen'/></a> | Job Queue
[queue_job_batch](queue_job_batch/) | 16.0.1.0.1 | | Job Queue Batch
[queue_job_cron](queue_job_cron/) | 16.0.2.1.0 | | Scheduled Actions as Queue Jobs
[queue_job_cron_jobrunner](queue_job_cron_jobrunner/) | 16.0.1.1.0 | <a href='https://github.com/ivantodorovich'><img src='https://github.com/ivantodorovich.png' width='32' height='32' style='border-radius:50%;' alt='ivantodorovich'/></a> | Run jobs without a dedicated JobRunner
[queue_job_subscribe](queue_job_subscribe/) | 16.0.1.1.0 | | Control which users are subscribed to queue job notifications
[queue_job_web_notify](queue_job_web_notify/) | 16.0.1.0.0 | | This module allows to display a notification to the related user of a failed job. It uses the web_notify notification feature.
[test_queue_job](test_queue_job/) | 16.0.2.3.0 | | Queue Job Tests
[test_queue_job](test_queue_job/) | 16.0.2.4.0 | | Queue Job Tests
[test_queue_job_batch](test_queue_job_batch/) | 16.0.1.0.0 | | Test Job Queue Batch


Expand Down
8 changes: 6 additions & 2 deletions base_export_async/README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=================
Base Export Async
=================
Expand All @@ -7,13 +11,13 @@ Base Export Async
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:85ce335207ce3505a7676a8a78743155f9f8c01d1c6f777fe2308c5e77f00e5a
!! source digest: sha256:da52a05130a89cd0000a39c9dd6315821387de2c310f9cf7cc1f7e6e8541fe55
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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
.. |badge2| image:: https://img.shields.io/badge/license-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%2Fqueue-lightgray.png?logo=github
Expand Down
2 changes: 1 addition & 1 deletion base_export_async/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Base Export Async",
"summary": "Asynchronous export with job queue",
"version": "16.0.1.1.0",
"version": "16.0.1.2.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/queue",
Expand Down
4 changes: 4 additions & 0 deletions base_export_async/models/delay_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ def export(self, params):
attachment.name,
)

if any(user.has_group("base.group_portal") for user in users):
attachment.generate_access_token()
url += f"&access_token={attachment.access_token}"

time_to_live = (
self.env["ir.config_parameter"].sudo().get_param("attachment.ttl", 7)
)
Expand Down
28 changes: 17 additions & 11 deletions base_export_async/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Base Export Async</title>
<title>README.rst</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,16 +360,21 @@
</style>
</head>
<body>
<div class="document" id="base-export-async">
<h1 class="title">Base Export Async</h1>
<div class="document">


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="base-export-async">
<h1>Base Export Async</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:85ce335207ce3505a7676a8a78743155f9f8c01d1c6f777fe2308c5e77f00e5a
!! source digest: sha256:da52a05130a89cd0000a39c9dd6315821387de2c310f9cf7cc1f7e6e8541fe55
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/queue/tree/16.0/base_export_async"><img alt="OCA/queue" src="https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-base_export_async"><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/queue&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<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/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/queue/tree/16.0/base_export_async"><img alt="OCA/queue" src="https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-base_export_async"><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/queue&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Standard Export can be delayed in asynchronous jobs executed in the background and then send by email to the user.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand All @@ -385,38 +390,38 @@ <h1 class="title">Base Export Async</h1>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
<p>The user is presented with a new checkbox “Asynchronous export”
in the export screen. When selected, the export is delayed in a
background job.</p>
<p>The .csv or .xls file generated by the export will be sent by email
to the user who execute the export.</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/queue/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 to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/queue/issues/new?body=module:%20base_export_async%0Aversion:%2016.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">
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
<h2><a class="toc-backref" href="#toc-entry-3">Credits</a></h2>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<h3><a class="toc-backref" href="#toc-entry-4">Authors</a></h3>
<ul class="simple">
<li>ACSONE SA/NV</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
<ul class="simple">
<li>Arnaud Pineux (ACSONE SA/NV) authored the initial prototype.</li>
<li>Guewen Baconnier (Camptocamp)</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand All @@ -429,5 +434,6 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
</div>
</div>
</div>
</div>
</body>
</html>
19 changes: 19 additions & 0 deletions base_export_async/tests/test_base_export_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,22 @@ def test_cron_delete(self):

# The attachment must be deleted
self.assertFalse(new_attachment.exists())

def test_portal_export(self):
"""Check that we make attachments externally accessible for portal users"""
portal_user = self.env["res.users"].create(
{
"login": "base_export_async_portal_user",
"name": "base_export_async_portal_user",
"groups_id": self.env.ref("base.group_portal").ids,
}
)
params = json.loads(data_csv.get("data"))
params["user_ids"] = portal_user.ids
attachments = self.env["ir.attachment"].search([])
mails = self.env["mail.mail"].search([])
self.delay_export_obj.export(params)
new_attachment = self.env["ir.attachment"].search([]) - attachments
self.assertTrue(new_attachment.access_token)
new_mail = self.env["mail.mail"].search([]) - mails
self.assertIn("&amp;access_token=", new_mail.body)
2 changes: 1 addition & 1 deletion queue_job/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Job Queue
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d14c52037a007ed26c3868531df1cef148fcc85fb5cee8b35e34f3522879cc0f
!! source digest: sha256:b92d06dbbf161572f2bf02e0c6a59282cea11cc5e903378094bead986f0125de
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
Expand Down
2 changes: 1 addition & 1 deletion queue_job/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "Job Queue",
"version": "16.0.2.11.5",
"version": "16.0.2.12.0",
"author": "Camptocamp,ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/queue",
"license": "LGPL-3",
Expand Down
8 changes: 7 additions & 1 deletion queue_job/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,13 @@ def _enqueue_dependent_jobs(self, env, job):
else:
break

@http.route("/queue_job/runjob", type="http", auth="none", save_session=False)
@http.route(
"/queue_job/runjob",
type="http",
auth="none",
save_session=False,
readonly=False,
)
def runjob(self, db, job_uuid, **kw):
http.request.session.db = db
env = http.request.env(user=SUPERUSER_ID)
Expand Down
6 changes: 6 additions & 0 deletions queue_job/i18n/ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,7 @@ msgstr "Pendent"

#. module: queue_job
#: model:ir.model.fields,field_description:queue_job.field_queue_job__priority
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Priority"
msgstr "Prioritat"

Expand Down Expand Up @@ -904,6 +905,11 @@ msgid "Time required to execute this job in seconds. Average when grouped."
msgstr ""
"Temps necessari per executar el treball en segons. Mitjana quan s'agrupa."

#. module: queue_job
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Tried many times"
msgstr ""

#. module: queue_job
#: model:ir.model.fields,help:queue_job.field_queue_job__activity_exception_decoration
msgid "Type of the exception activity on record."
Expand Down
10 changes: 8 additions & 2 deletions queue_job/i18n/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ msgstr "Ausstehend"

#. module: queue_job
#: model:ir.model.fields,field_description:queue_job.field_queue_job__priority
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Priority"
msgstr "Priorität"

Expand Down Expand Up @@ -929,6 +930,11 @@ msgstr ""
"Benötigte Zeit zur Ausführung dieses Jobs in Sekunden. Bei Gruppierung wird "
"der Durchschnitt ermittelt."

#. module: queue_job
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Tried many times"
msgstr ""

#. module: queue_job
#: model:ir.model.fields,help:queue_job.field_queue_job__activity_exception_decoration
msgid "Type of the exception activity on record."
Expand All @@ -951,8 +957,8 @@ msgid ""
msgstr ""
"Unerwartetes Format der zugehörigen Aktion für {}.\n"
"Beispiel für ein gültiges Format:\n"
"{{\"enable\": True, \"func_name\": \"related_action_foo\", \"kwargs\" {{"
"\"limit\": 10}}}}"
"{{\"enable\": True, \"func_name\": \"related_action_foo\", "
"\"kwargs\" {{\"limit\": 10}}}}"

#. module: queue_job
#. odoo-python
Expand Down
6 changes: 6 additions & 0 deletions queue_job/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ msgstr "Pendiente"

#. module: queue_job
#: model:ir.model.fields,field_description:queue_job.field_queue_job__priority
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Priority"
msgstr "Prioridad"

Expand Down Expand Up @@ -923,6 +924,11 @@ msgstr ""
"Tiempo requerido para ejecutar este trabajo en segundos. Promedio cuando se "
"agrupa."

#. module: queue_job
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Tried many times"
msgstr ""

#. module: queue_job
#: model:ir.model.fields,help:queue_job.field_queue_job__activity_exception_decoration
msgid "Type of the exception activity on record."
Expand Down
6 changes: 6 additions & 0 deletions queue_job/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ msgstr "En attente"

#. module: queue_job
#: model:ir.model.fields,field_description:queue_job.field_queue_job__priority
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Priority"
msgstr "Priorité"

Expand Down Expand Up @@ -923,6 +924,11 @@ msgstr ""
"Temps requis pour exécuter cette tâche en seconde. Moyenne lors des "
"regroupements."

#. module: queue_job
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Tried many times"
msgstr ""

#. module: queue_job
#: model:ir.model.fields,help:queue_job.field_queue_job__activity_exception_decoration
msgid "Type of the exception activity on record."
Expand Down
6 changes: 6 additions & 0 deletions queue_job/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ msgstr "In attesa"

#. module: queue_job
#: model:ir.model.fields,field_description:queue_job.field_queue_job__priority
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Priority"
msgstr "Priorità"

Expand Down Expand Up @@ -920,6 +921,11 @@ msgid "Time required to execute this job in seconds. Average when grouped."
msgstr ""
"Tempo in secondi richiesto per eseguire il lavoro. Medio quando raggruppati."

#. module: queue_job
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Tried many times"
msgstr ""

#. module: queue_job
#: model:ir.model.fields,help:queue_job.field_queue_job__activity_exception_decoration
msgid "Type of the exception activity on record."
Expand Down
6 changes: 6 additions & 0 deletions queue_job/i18n/queue_job.pot
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ msgstr ""

#. module: queue_job
#: model:ir.model.fields,field_description:queue_job.field_queue_job__priority
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Priority"
msgstr ""

Expand Down Expand Up @@ -887,6 +888,11 @@ msgstr ""
msgid "Time required to execute this job in seconds. Average when grouped."
msgstr ""

#. module: queue_job
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Tried many times"
msgstr ""

#. module: queue_job
#: model:ir.model.fields,help:queue_job.field_queue_job__activity_exception_decoration
msgid "Type of the exception activity on record."
Expand Down
6 changes: 6 additions & 0 deletions queue_job/i18n/tr.po
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ msgstr "Beklemede"

#. module: queue_job
#: model:ir.model.fields,field_description:queue_job.field_queue_job__priority
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Priority"
msgstr "Öncelik"

Expand Down Expand Up @@ -920,6 +921,11 @@ msgstr ""
"Saniye cinsinden bu işi yapmak için gereken süre. Gruplandığında ortalaması "
"alınır."

#. module: queue_job
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Tried many times"
msgstr ""

#. module: queue_job
#: model:ir.model.fields,help:queue_job.field_queue_job__activity_exception_decoration
msgid "Type of the exception activity on record."
Expand Down
6 changes: 6 additions & 0 deletions queue_job/i18n/zh_CN.po
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ msgstr "等待"

#. module: queue_job
#: model:ir.model.fields,field_description:queue_job.field_queue_job__priority
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Priority"
msgstr "优先级"

Expand Down Expand Up @@ -906,6 +907,11 @@ msgstr ""
msgid "Time required to execute this job in seconds. Average when grouped."
msgstr ""

#. module: queue_job
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Tried many times"
msgstr ""

#. module: queue_job
#: model:ir.model.fields,help:queue_job.field_queue_job__activity_exception_decoration
msgid "Type of the exception activity on record."
Expand Down
Loading