Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Available addons
addon | version | maintainers | summary
--- | --- | --- | ---
[base_import_async](base_import_async/) | 18.0.1.0.0 | | Import CSV files in the background
[queue_job](queue_job/) | 18.0.1.7.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](queue_job/) | 18.0.1.7.1 | <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/) | 18.0.1.0.0 | | Job Queue Batch
[queue_job_cron](queue_job_cron/) | 18.0.1.1.1 | | Scheduled Actions as Queue Jobs
[queue_job_cron_jobrunner](queue_job_cron_jobrunner/) | 18.0.1.0.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
Expand Down
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:1546ea44a63ecafe2dcee75567a04b4df20b00c51c1494a42056b388ddec15ad
!! source digest: sha256:93bf08eab226d25a64e06bcf90f0fb7f40f81ac6c18f9d902b0cd7e9be75ebef
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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": "18.0.1.7.0",
"version": "18.0.1.7.1",
"author": "Camptocamp,ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/queue",
"license": "LGPL-3",
Expand Down
6 changes: 0 additions & 6 deletions queue_job/i18n/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -655,12 +655,6 @@ msgstr "Warteschlange"
msgid "Queue Job"
msgstr "Job einreihen"

#. module: queue_job
#. odoo-python
#: code:addons/queue_job/models/queue_job.py:0
msgid "Queue jobs must be created by calling 'with_delay()'."
msgstr ""

#. module: queue_job
#: model:ir.model.fields,field_description:queue_job.field_queue_job__records
#, fuzzy
Expand Down
9 changes: 3 additions & 6 deletions queue_job/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -665,12 +665,6 @@ msgstr "Cola"
msgid "Queue Job"
msgstr "Cola de trabajos"

#. module: queue_job
#. odoo-python
#: code:addons/queue_job/models/queue_job.py:0
msgid "Queue jobs must be created by calling 'with_delay()'."
msgstr "Los trabajos en cola deben crearse llamando a 'with_delay()'."

#. module: queue_job
#: model:ir.model.fields,field_description:queue_job.field_queue_job__records
msgid "Record(s)"
Expand Down Expand Up @@ -941,6 +935,9 @@ msgstr "Asistente para volver a poner en cola una selección de trabajos"
msgid "Worker Pid"
msgstr "Pid del trabajador"

#~ msgid "Queue jobs must be created by calling 'with_delay()'."
#~ msgstr "Los trabajos en cola deben crearse llamando a 'with_delay()'."

#~ msgid "SMS Delivery error"
#~ msgstr "Error de entrega del SMS"

Expand Down
9 changes: 3 additions & 6 deletions queue_job/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -662,12 +662,6 @@ msgstr "Coda"
msgid "Queue Job"
msgstr "Lavoro in coda"

#. module: queue_job
#. odoo-python
#: code:addons/queue_job/models/queue_job.py:0
msgid "Queue jobs must be created by calling 'with_delay()'."
msgstr "Il lavoro in coda deve essere creato chiamando 'with_delay()'."

#. module: queue_job
#: model:ir.model.fields,field_description:queue_job.field_queue_job__records
msgid "Record(s)"
Expand Down Expand Up @@ -940,6 +934,9 @@ msgstr "Procedura guidata per riaccodare una selezione di lavori"
msgid "Worker Pid"
msgstr "PID worker"

#~ msgid "Queue jobs must be created by calling 'with_delay()'."
#~ msgstr "Il lavoro in coda deve essere creato chiamando 'with_delay()'."

#~ msgid "SMS Delivery error"
#~ msgstr "Errore consegna SMS"

Expand Down
6 changes: 0 additions & 6 deletions queue_job/i18n/queue_job.pot
Original file line number Diff line number Diff line change
Expand Up @@ -645,12 +645,6 @@ msgstr ""
msgid "Queue Job"
msgstr ""

#. module: queue_job
#. odoo-python
#: code:addons/queue_job/models/queue_job.py:0
msgid "Queue jobs must be created by calling 'with_delay()'."
msgstr ""

#. module: queue_job
#: model:ir.model.fields,field_description:queue_job.field_queue_job__records
msgid "Record(s)"
Expand Down
9 changes: 3 additions & 6 deletions queue_job/i18n/tr.po
Original file line number Diff line number Diff line change
Expand Up @@ -662,12 +662,6 @@ msgstr "Kuyruk"
msgid "Queue Job"
msgstr "Kuyruk İşi"

#. module: queue_job
#. odoo-python
#: code:addons/queue_job/models/queue_job.py:0
msgid "Queue jobs must be created by calling 'with_delay()'."
msgstr "Kuyruk işleri 'with_delay()' çağrılarak oluşturulmalıdır."

#. module: queue_job
#: model:ir.model.fields,field_description:queue_job.field_queue_job__records
msgid "Record(s)"
Expand Down Expand Up @@ -940,5 +934,8 @@ msgstr "Seçilen işleri yeniden sıraya almak için sihirbaz"
msgid "Worker Pid"
msgstr "Çalışan Pid"

#~ msgid "Queue jobs must be created by calling 'with_delay()'."
#~ msgstr "Kuyruk işleri 'with_delay()' çağrılarak oluşturulmalıdır."

#~ msgid "SMS Delivery error"
#~ msgstr "SMS Teslim hatası"
6 changes: 0 additions & 6 deletions queue_job/i18n/tr_TR.po
Original file line number Diff line number Diff line change
Expand Up @@ -650,12 +650,6 @@ msgstr ""
msgid "Queue Job"
msgstr ""

#. module: queue_job
#. odoo-python
#: code:addons/queue_job/models/queue_job.py:0
msgid "Queue jobs must be created by calling 'with_delay()'."
msgstr ""

#. module: queue_job
#: model:ir.model.fields,field_description:queue_job.field_queue_job__records
msgid "Record(s)"
Expand Down
9 changes: 3 additions & 6 deletions queue_job/i18n/zh_CN.po
Original file line number Diff line number Diff line change
Expand Up @@ -660,12 +660,6 @@ msgstr "队列"
msgid "Queue Job"
msgstr "队列作业"

#. module: queue_job
#. odoo-python
#: code:addons/queue_job/models/queue_job.py:0
msgid "Queue jobs must be created by calling 'with_delay()'."
msgstr "队列任务必须通过调用'with_delay()'方法来创建。"

#. module: queue_job
#: model:ir.model.fields,field_description:queue_job.field_queue_job__records
msgid "Record(s)"
Expand Down Expand Up @@ -930,6 +924,9 @@ msgstr "重新排队向导所选的作业"
msgid "Worker Pid"
msgstr "工作进程PID"

#~ msgid "Queue jobs must be created by calling 'with_delay()'."
#~ msgstr "队列任务必须通过调用'with_delay()'方法来创建。"

#~ msgid "SMS Delivery error"
#~ msgstr "短信传递错误"

Expand Down
7 changes: 1 addition & 6 deletions queue_job/models/queue_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,8 @@ def _compute_graph_jobs_count(self):
record.graph_jobs_count = count_per_graph_uuid.get(record.graph_uuid) or 0

@api.model_create_multi
@api.private
def create(self, vals_list):
if self.env.context.get("_job_edit_sentinel") is not self.EDIT_SENTINEL:
# Prevent to create a queue.job record "raw" from RPC.
# ``with_delay()`` must be used.
raise exceptions.AccessError(
_("Queue jobs must be created by calling 'with_delay()'.")
)
return super(
QueueJob,
self.with_context(mail_create_nolog=True, mail_create_nosubscribe=True),
Expand Down
2 changes: 1 addition & 1 deletion queue_job/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ <h1>Job Queue</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1546ea44a63ecafe2dcee75567a04b4df20b00c51c1494a42056b388ddec15ad
!! source digest: sha256:93bf08eab226d25a64e06bcf90f0fb7f40f81ac6c18f9d902b0cd7e9be75ebef
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/queue/tree/18.0/queue_job"><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-18-0/queue-18-0-queue_job"><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=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This addon adds an integrated Job Queue to Odoo.</p>
Expand Down
26 changes: 22 additions & 4 deletions queue_job/tests/test_queue_job_protected_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,33 @@

from odoo import exceptions
from odoo.tests import common
from odoo.tools import mute_logger


class TestJobWriteProtected(common.TransactionCase):
class TestJobCreatePrivate(common.HttpCase):
def test_create_error(self):
with self.assertRaises(exceptions.AccessError):
self.env["queue.job"].create(
{"uuid": "test", "model_name": "res.partner", "method_name": "write"}
self.authenticate("admin", "admin")
with self.assertRaises(common.JsonRpcException) as cm, mute_logger("odoo.http"):
self.make_jsonrpc_request(
"/web/dataset/call_kw",
params={
"model": "queue.job",
"method": "create",
"args": [],
"kwargs": {
"method_name": "write",
"model_name": "res.partner",
"uuid": "test",
},
},
headers={
"Cookie": f"session_id={self.session.sid};",
},
)
self.assertEqual("odoo.exceptions.AccessError", str(cm.exception))


class TestJobWriteProtected(common.TransactionCase):
def test_write_protected_field_error(self):
job_ = self.env["res.partner"].with_delay().create({"name": "test"})
db_job = job_.db_record()
Expand Down