Sunday, September 26, 2021
1 change · master
Enhancements to existing features
Odoo now uses a standard Python mechanism to manage internal execution context instead of relying on an external web library component. This reduces unnecessary dependency usage and better prepares Odoo for modern asynchronous server setups, with no direct change expected for everyday users.
Original PR description
Since version 3.7 python has a [contextvars](https://docs.python.org/3.7/library/contextvars.html) module which provides similar functionality to thread local variables. By using it we - use a stdlib feature and remove a dependency on werkzeug in a place where it is not necessary - allow using the Odoo api where Odoo Environments span several threads launched from an async context (such as an ASGI server) If this patch is accepted, I can look at doing something similar for the dbname thread local that is used in a few places. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr