diff --git a/queue_job_context/README.rst b/queue_job_context/README.rst new file mode 100644 index 0000000000..e69de29bb2 diff --git a/queue_job_context/__init__.py b/queue_job_context/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/queue_job_context/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/queue_job_context/__manifest__.py b/queue_job_context/__manifest__.py new file mode 100644 index 0000000000..e5e4cb9d4b --- /dev/null +++ b/queue_job_context/__manifest__.py @@ -0,0 +1,15 @@ +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html) +# Copyright 2022 Ooops (ooops404.com) + +{ + "name": "Queue Job Context", + "summary": "Queue Job, prepare context before enqueue keys", + "author": "Giovanni Serra - GSLab.it, Ooops, Odoo Community Association (OCA)", + "maintainers": ["AshishHirapara"], + "license": "LGPL-3", + "website": "https://github.com/OCA/queue", + "category": "Tools", + "version": "14.0.1.0.0", + "depends": ["queue_job"], + "installable": True, +} diff --git a/queue_job_context/models/__init__.py b/queue_job_context/models/__init__.py new file mode 100644 index 0000000000..0e44449338 --- /dev/null +++ b/queue_job_context/models/__init__.py @@ -0,0 +1 @@ +from . import base diff --git a/queue_job_context/models/base.py b/queue_job_context/models/base.py new file mode 100644 index 0000000000..23385b0377 --- /dev/null +++ b/queue_job_context/models/base.py @@ -0,0 +1,12 @@ +from odoo import api, models + + +class Base(models.AbstractModel): + _inherit = "base" + + @api.model + def _job_prepare_context_before_enqueue_keys(self): + """Keys to keep in context of stored jobs + Empty by default for backward compatibility. + """ + return ("tz", "lang", "allowed_company_ids", "force_company", "active_test") diff --git a/queue_job_context/readme/CONFIGURE.rst b/queue_job_context/readme/CONFIGURE.rst new file mode 100644 index 0000000000..e69de29bb2 diff --git a/queue_job_context/readme/CONTRIBUTORS.rst b/queue_job_context/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..afc24227c2 --- /dev/null +++ b/queue_job_context/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Ooops - Ashish Hirpara diff --git a/queue_job_context/readme/DESCRIPTION.rst b/queue_job_context/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..d740317224 --- /dev/null +++ b/queue_job_context/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Set the list of context keys that are propagated to jobs ("tz", "lang", "allowed_company_ids", "force_company", "active_test"). This will become the default in 16.0. diff --git a/queue_job_context/static/description/icon.png b/queue_job_context/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/queue_job_context/static/description/icon.png differ diff --git a/queue_job_context/static/description/index.html b/queue_job_context/static/description/index.html new file mode 100644 index 0000000000..2a7fb1a505 --- /dev/null +++ b/queue_job_context/static/description/index.html @@ -0,0 +1,427 @@ + + + + + + +Ooops Queue Job Context + + + +
+

Ooops Queue Job Context

+ + +

Beta License: LGPL-3 ooops404/ooops-tools Translate me on Weblate Try me on Runbot

+

Queue Job, prepare context before enqueue keys

+

Table of contents

+ +
+

Changelog

+
+

14.0.1.0.0

+
    +
  • Initial release
  • +
+
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Ooops
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the ooops404/ooops-tools project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/setup/queue_job_context/odoo/addons/queue_job_context b/setup/queue_job_context/odoo/addons/queue_job_context new file mode 120000 index 0000000000..d122d929fc --- /dev/null +++ b/setup/queue_job_context/odoo/addons/queue_job_context @@ -0,0 +1 @@ +../../../../queue_job_context \ No newline at end of file diff --git a/setup/queue_job_context/setup.py b/setup/queue_job_context/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/queue_job_context/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)