odoo
odoo copied to clipboard
[MERGE] [FIX] various: adapt 14.0 to work with ubuntu jammy (22.04)
Ubuntu Jammy brings some breaking changes for odoo 14.0. This PR aims to ensure compatibility if deployed on ubuntu Jammy. This PR is mainly a backport of #88803
Main changes
- support for python 3.10
- werkzeug 2.0+, including vendoring werkzeug's user agent parser in odoo/tools/_vendor/useragents.py (= the one from version 0.16) as it is discontinued after v2.1
- currentThread is now deprecated (use current_thread instead)
- default requirement version (based on deb package version)
- new opcode in python 3.10
- distutils.version.LooseVersion is deprecated
wkhtmltopdf
wkhtmltopdf version packaged with ubuntu jammy doesn't have patched qt but will work without headers and footers. Suggested wkhtmltopdf version 0.12.5 doesn't have a build working with jammy yet because of incompatible libssl dependencies. A working version can be found on nightly server.
As usual, all changes are made with the spirit to keep compatibility with previous version (Focal)
enterprise PR: odoo/enterprise#30412
@robodoo override=ci/security
Mostly getattr on the current thread for testing, but also a few import changes due to werkzeug.utils.unescape going away.
@fw-bot ignore
Forward-port disabled.
Some of those changes are actually unnecessary for compatibility. Everything that has to do with newer DeprecationWarnings can be safely handled with an extra filterwarnings().
It's kind of the point: we know about those deprecations, and we deal with them in master. If the code still works, changing it in stable versions to avoid a mere warning is not a good trade-off.
Commit-wise:
-
_vendor: fix compatibility with werkzeug 2.0+ ok
-
core: ignore invalid escape sequence in 3.10 ok, it's already a warnings filter
-
report: replace deprecated LooseVersion method not needed, still works fine -> filter the DeprecationWarnings instead
-
various: replace deprecated currentThread method not needed, still works fine -> filter the DeprecationWarnings instead
-
server: replace deprecated daemon getter/setter not needed, still works fine -> filter the DeprecationWarnings instead
-
tools, qweb: vendoring werkzeug escape ok
-
safe_eval: add new py 3.10 GEN_START opcode ok
-
requirements: adapt for ubuntu ok
-
link_tracker, pos_mercury: use unescape from html ok
-
http: use vendored user agent parser ok
-
http, web: use Response instead of BaseResponse ok
-
http_routing: properly handle httprequest.path ok, but not sure how safe the patch is
-
bus: deprecated threading attribute (and then some) I think the only needed part is the
import gevent.eventfix. -
base: filter out reportlab deprecation warning ok, already a filterwarnings
-
website: return string for login redirect ok
FYI there is a special build on the enterprise trigger with 3 sub-builds:
- Ubuntu 22 with requirements installed at build time
- Ubuntu 22 without requirements
- Normal build (Focal)
@fw-bot ignore Ping @odony I think it's good now.
Forward-port disabled.

robodoo r+
@d-fence you may want to rebuild or fix this PR as it has failed CI.
robodoo rebase-merge
Merge method set to rebase and merge, using the PR as merge commit message.
didn't see the red ci/style immediately ...
robodoo r+