diff --git a/queue_job_context/README.rst b/queue_job_context/README.rst new file mode 100644 index 0000000000..72a86203b3 --- /dev/null +++ b/queue_job_context/README.rst @@ -0,0 +1,85 @@ +================= +Queue Job Context +================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:a396fff9b7f6110b98599e27afeaa160162bc9e816449372dd3eebf90cd994f8 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github + :target: https://github.com/OCA/queue/tree/14.0/queue_job_context + :alt: OCA/queue +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/queue-14-0/queue-14-0-queue_job_context + :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/queue&target_branch=14.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +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. + +**Table of contents** + +.. contents:: + :local: + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Giovanni Serra - GSLab.it +* Ooops + +Contributors +~~~~~~~~~~~~ + +* Ooops - Ashish Hirpara + +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-AshishHirapara| image:: https://github.com/AshishHirapara.png?size=40px + :target: https://github.com/AshishHirapara + :alt: AshishHirapara + +Current `maintainer `__: + +|maintainer-AshishHirapara| + +This module is part of the `OCA/queue `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. 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..b066404d1e --- /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": "15.0.1.0.0", + "depends": ["queue_job"], + "installable": True, +} diff --git a/queue_job_context/i18n/it.po b/queue_job_context/i18n/it.po new file mode 100644 index 0000000000..6d35b7fd9e --- /dev/null +++ b/queue_job_context/i18n/it.po @@ -0,0 +1,22 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * queue_job_context +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-02-05 09:35+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: queue_job_context +#: model:ir.model,name:queue_job_context.model_base +msgid "Base" +msgstr "Base" diff --git a/queue_job_context/i18n/queue_job_context.pot b/queue_job_context/i18n/queue_job_context.pot new file mode 100644 index 0000000000..0ad3f6e0dc --- /dev/null +++ b/queue_job_context/i18n/queue_job_context.pot @@ -0,0 +1,19 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * queue_job_context +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: queue_job_context +#: model:ir.model,name:queue_job_context.model_base +msgid "Base" +msgstr "" 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..4b636033c4 --- /dev/null +++ b/queue_job_context/static/description/index.html @@ -0,0 +1,424 @@ + + + + + + +Queue Job Context + + + +
+

Queue Job Context

+ + +

Beta License: LGPL-3 OCA/queue Translate me on Weblate Try me on Runboat

+

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.

+

Table of contents

+ +
+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Giovanni Serra - GSLab.it
  • +
  • Ooops
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

Current maintainer:

+

AshishHirapara

+

This module is part of the OCA/queue project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/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, +)