c3714eafbd07f7c7b98ff98bc604d76db4fe1c7b
This commit is the 1st commit of a comprehensive refactor of our HTTP framework. See odoo/odoo#78857 for complete historic, discussions and rationnals. Our application framework is quite complicated. There are a few explicit middlewares: `ProxyFix`, `DisableCacheMiddleware`, `SharedDataMiddleware`. There are many (13, in total) implicit ones in the form of `ir.http._dispatch` overrides. There are a few frames that don't have much values by themselves and are very much implementation details there are: `application_unproxied`, `_call_function`, `checked_call` and `EndPoint.__call__`. The ORM initialisation is quite magical, the cursor, registry and environment are all setup lazily thanks to class properties. The context and uid of the environment are aliased on the request. The abuse of properties makes it impossible to reason about where and when the environment is actually instantiated and modified. The dispatch of a request follow the next scheme: `odoo.http/Root.dispatch` -> `odoo.addons.base.models/ir.http._dispatch` -> `odoo.http/(Http|Json)Request.dispatch` -> `odoo.http/@route` -> controller. Because the request becomes http or json specialized quite late, the many ir.http override all need to parsimony try/except their code in order to manually call `_handle_exception()` uppon error, they cannot let the error bubble-up. This back-and-forth between odoo.http and ir.http is source of some headaches. Speaking about error, the `odoo.http/WebRequest._handle_exception` implementation is quite complicated, it basically craft a new exception out of the passed exception object in order to correct its traceback. If the error had been bubbled-up instead of handled by `_handle_exception()` such python hack would not have been necessary. The objectives of this refactor are about refounding the technical dept: * We want shorter error reporting; * We want simpler request and ir.http APIs; * We want better integration of all the ir.http extensions. PR: odoo#78857 Task: 2571224
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%