-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16.0][MIG] dbfilter_from_header #2425
[16.0][MIG] dbfilter_from_header #2425
Conversation
Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
[MIG] migrate dbfilter_from_header to 10.0 I have also removed the ability to use HTTP_X_OPENERP_DBFILTER Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
updates were made in OCA#1137 by @TimLai125 and small lint fixes by @yelizariev Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be> [UPD] Update dbfilter_from_header.pot Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be> [UPD] README.rst Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be> [UPD] Update dbfilter_from_header.pot Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: server-tools-13.0/server-tools-13.0-dbfilter_from_header Translate-URL: https://translation.odoo-community.org/projects/server-tools-13-0/server-tools-13-0-dbfilter_from_header/ Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be> [UPD] Update dbfilter_from_header.pot Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be> [UPD] README.rst Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be> [UPD] Update dbfilter_from_header.pot Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be> [UPD] README.rst Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
Hey @carmenbianca, thank you for your Pull Request. It looks like some users haven't signed our Contributor License Agreement, yet.
Appreciation of efforts, |
Not making decent progress on this. The signature of The upstream if config['dbfilter']:
# host
# -----------
# www.example.com:80
# -------
# domain
if host is None:
host = request.httprequest.environ.get('HTTP_HOST', '') If I pause my debugger on the first line and execute Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/var/home/coopiteasy/.virtualenvs/odoo16/lib64/python3.10/site-packages/werkzeug/local.py", line 432, in __get__
obj = instance._get_current_object()
File "/var/home/coopiteasy/.virtualenvs/odoo16/lib64/python3.10/site-packages/werkzeug/local.py", line 554, in _get_current_object
return self.__local() # type: ignore
File "/var/home/coopiteasy/.virtualenvs/odoo16/lib64/python3.10/site-packages/werkzeug/local.py", line 226, in _lookup
raise RuntimeError("object unbound")
RuntimeError: object unbound The request object is So the Odoo code seems broken to me in any scenario where So of course, when I do Traceback (most recent call last):
File "/home/odoo16/venv/lib/python3.8/site-packages/werkzeug/serving.py", line 306, in run_wsgi
execute(self.server.app)
File "/home/odoo16/venv/lib/python3.8/site-packages/werkzeug/serving.py", line 294, in execute
application_iter = app(environ, start_response)
File "/home/odoo16/src/odoo/odoo/http.py", line 1942, in __call__
request = Request(httprequest)
File "/home/odoo16/src/odoo/odoo/http.py", line 1101, in __init__
self.session, self.db = self._get_session_and_dbname()
File "/home/odoo16/src/odoo/odoo/http.py", line 1133, in _get_session_and_dbname
if session.db and db_filter([session.db], host=host):
File "/home/odoo16/src/oca/server-tools/dbfilter_from_header/override.py", line 17, in db_filter
print(http.request)
File "/home/odoo16/venv/lib/python3.8/site-packages/werkzeug/local.py", line 367, in <lambda>
__str__ = lambda x: str(x._get_current_object())
File "/home/odoo16/venv/lib/python3.8/site-packages/werkzeug/local.py", line 307, in _get_current_object
return self.__local()
File "/home/odoo16/venv/lib/python3.8/site-packages/werkzeug/local.py", line 137, in _lookup
raise RuntimeError("object unbound")
RuntimeError: object unbound - - - The request objects that we actually want is in the process of being created in line 1101 above (Request's Not sure what the correct course of action is to tackle this problem. |
Hello @carmenbianca I faced this issue as well. Worked around it here. Not very elegant, but works 😅 Thoughts welcome! |
Just tested on a virsh setup seems to be working well, mention me when your ready for it to be merged and (providing there's no drastic changes) i will code review it. Should be able to get OCA Bot to kick in then. |
Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
4a24a5b
to
e6cec53
Compare
Squashed the last commit. Just tested this as well → it works. Ready for merging as far as I'm concerned. |
This PR has the |
Tested this in a QA environment with multiple instances of Odoo 16 and it works well 🤙 |
/ocabot merge nobump |
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at adcb6e5. Thanks a lot for contributing to OCA. ❤️ |
/ocabot migration dbfilter_from_header |
No description provided.