forked from trevi-software/server-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates were made in OCA#1137 by @TimLai125 and small lint fixes by @yelizariev
- Loading branch information
Showing
5 changed files
with
28 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ a server-wide module. | |
This can be done with the ``load`` parameter in ``/etc/odoo.conf`` or with the | ||
``--load`` command-line parameter | ||
|
||
``load = "web, web_kanban, dbfilter_from_header"`` | ||
``load = "web, dbfilter_from_header"`` | ||
|
||
Configuration | ||
============= | ||
|
@@ -62,6 +62,7 @@ Contributors | |
* Sandy Carter <[email protected]> | ||
* Fabio Vilchez <[email protected]> | ||
* Jos De Graeve <[email protected]> | ||
* Lai Tim Siu (Quaritle Limited) <[email protected]> | ||
|
||
Maintainer | ||
---------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2013 Therp BV | ||
# © 2014 ACSONE SA/NV | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
import re | ||
from odoo import http | ||
|
||
db_filter_org = http.db_filter | ||
|
||
|
||
def db_filter(dbs, httprequest=None): | ||
dbs = db_filter_org(dbs, httprequest) | ||
httprequest = httprequest or http.request.httprequest | ||
db_filter_hdr = httprequest.environ.get('HTTP_X_ODOO_DBFILTER') | ||
if db_filter_hdr: | ||
dbs = [db for db in dbs if re.match(db_filter_hdr, db)] | ||
return dbs | ||
|
||
http.db_filter = db_filter | ||
from . import override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# © 2013 Therp BV | ||
# © 2014 ACSONE SA/NV | ||
# Copyright 2018 Quartile Limited | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
import re | ||
from odoo import http | ||
|
||
db_filter_org = http.db_filter | ||
|
||
|
||
def db_filter(dbs, httprequest=None): | ||
dbs = db_filter_org(dbs, httprequest) | ||
httprequest = httprequest or http.request.httprequest | ||
db_filter_hdr = httprequest.environ.get('HTTP_X_ODOO_DBFILTER') | ||
if db_filter_hdr: | ||
dbs = [db for db in dbs if re.match(db_filter_hdr, db)] | ||
return dbs | ||
|
||
|
||
http.db_filter = db_filter |