mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-19 14:32:02 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
25
odoo-bringout-oca-queue-queue_job/queue_job/post_load.py
Normal file
25
odoo-bringout-oca-queue-queue_job/queue_job/post_load.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import logging
|
||||
|
||||
from odoo import http
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def post_load():
|
||||
_logger.info(
|
||||
"Apply Request._get_session_and_dbname monkey patch to capture db"
|
||||
" from request with multiple databases"
|
||||
)
|
||||
_get_session_and_dbname_orig = http.Request._get_session_and_dbname
|
||||
|
||||
def _get_session_and_dbname(self):
|
||||
session, dbname = _get_session_and_dbname_orig(self)
|
||||
if (
|
||||
not dbname
|
||||
and self.httprequest.path == "/queue_job/runjob"
|
||||
and self.httprequest.args.get("db")
|
||||
):
|
||||
dbname = self.httprequest.args["db"]
|
||||
return session, dbname
|
||||
|
||||
http.Request._get_session_and_dbname = _get_session_and_dbname
|
||||
Loading…
Add table
Add a link
Reference in a new issue