Skip to content

Commit cd4a6d2

Browse files
[ADD][14.0] queue_job_context
initial commit - Add context before queue
1 parent 51df45a commit cd4a6d2

12 files changed

Lines changed: 465 additions & 0 deletions

File tree

queue_job_context/README.rst

Whitespace-only changes.

queue_job_context/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models

queue_job_context/__manifest__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
2+
# Copyright 2022 Ooops (ooops404.com)
3+
4+
{
5+
"name": "Queue Job Context",
6+
"summary": "Queue Job, prepare context before enqueue keys",
7+
"author": "Giovanni Serra - GSLab.it, Ooops, Odoo Community Association (OCA)",
8+
"contributors": ["Ashish Hirpara"],
9+
"license": "LGPL-3",
10+
"website": "https://github.com/OCA/queue",
11+
"category": "Tools",
12+
"version": "14.0.1.0.0",
13+
"depends": ["queue_job"],
14+
"installable": True,
15+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import base

queue_job_context/models/base.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from odoo import api, models
2+
3+
4+
class Base(models.AbstractModel):
5+
_inherit = "base"
6+
7+
@api.model
8+
def _job_prepare_context_before_enqueue_keys(self):
9+
"""Keys to keep in context of stored jobs
10+
Empty by default for backward compatibility.
11+
"""
12+
return ("tz", "lang", "allowed_company_ids", "force_company", "active_test")

queue_job_context/readme/CONFIGURE.rst

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Ooops - Ashish Hirpara <ashish.hirapara1995@gmail.com>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Queue Job, prepare context before enqueue keys
9.23 KB
Loading

0 commit comments

Comments
 (0)