From 819f2dfc4358ffc71b63cb340d7c19f7854a8463 Mon Sep 17 00:00:00 2001 From: Fabio Vilchez Date: Mon, 7 Mar 2016 16:54:46 -0600 Subject: [PATCH 1/2] [ADD] - dbfilter_from_header: Added module to version 9.0. --- dbfilter_from_header/__openerp__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbfilter_from_header/__openerp__.py b/dbfilter_from_header/__openerp__.py index d153809a3..ddafabe41 100644 --- a/dbfilter_from_header/__openerp__.py +++ b/dbfilter_from_header/__openerp__.py @@ -20,7 +20,7 @@ ############################################################################## { "name": "dbfilter_from_header", - "version": "8.0.1.0.0", + "version": "9.0.1.0.0", "author": "Therp BV,Odoo Community Association (OCA)", "license": "AGPL-3", "complexity": "normal", @@ -46,7 +46,7 @@ "css": [ ], "auto_install": False, - 'installable': False, + 'installable': True, "external_dependencies": { 'python': [], }, From 4a606fe7bf4e1644d4b6e6c7ee8b1609fb49cd0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 18 Nov 2015 22:16:10 +0100 Subject: [PATCH 2/2] [ADD] - cherry picked 5737ebc --- dbfilter_from_header/__init__.py | 9 ++++++--- dbfilter_from_header/__openerp__.py | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dbfilter_from_header/__init__.py b/dbfilter_from_header/__init__.py index 5f8b01ec0..14138f080 100644 --- a/dbfilter_from_header/__init__.py +++ b/dbfilter_from_header/__init__.py @@ -28,9 +28,12 @@ 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') or \ - httprequest.environ.get('HTTP_X_OPENERP_DBFILTER') + db_filter_hdr_odoo = httprequest.environ.get('HTTP_X_ODOO_DBFILTER') + db_filter_hdr_openerp = httprequest.environ.get('HTTP_X_OPENERP_DBFILTER') + if db_filter_hdr_odoo and db_filter_hdr_openerp: + raise RuntimeError("x-odoo-dbfilter and x-openerp-dbfiter " + "are both set") + db_filter_hdr = db_filter_hdr_odoo or db_filter_hdr_openerp if db_filter_hdr: dbs = [db for db in dbs if re.match(db_filter_hdr, db)] return dbs diff --git a/dbfilter_from_header/__openerp__.py b/dbfilter_from_header/__openerp__.py index ddafabe41..fd55f7b5e 100644 --- a/dbfilter_from_header/__openerp__.py +++ b/dbfilter_from_header/__openerp__.py @@ -30,8 +30,9 @@ This is interesting for setups where database names can't be mapped to proxied host names. - In nginx, use + In nginx, use one of proxy_set_header X-OpenERP-dbfilter [your filter]; + proxy_set_header X-Odoo-dbfilter [your filter]; The addon has to be loaded as server-wide module. """,