summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/env.js
AgeCommit message (Collapse)Author
2020-06-12[IMP] web,*: properly define env in the frontendAaron Bohy
*bus,mail This commit extracts the common basis of the env to use both in the frontend and the backend. The public env now contains most of the features that were previously (only) in the webclient env. Moreover, the PublicRoot no longer uses the ServiceProviderMixin, such that services are only deployed once, in the (public) env. Owl components can now be defined in the website, and rely on a properly built env. Legacy widgets still works as they access services through the PublicRoot (via trigger_up) which redirects those requests to the env.
2020-05-27[FIX] web: fix httpRequest GET + add in test_envMichael Mattiello (mcm)
This commit fixes the method GET in httpRequest and adds it in test_env. Before this commit, the GET method crashed because of the forced body param. closes odoo/odoo#51980 X-original-commit: 7c4fba660a13c38048020faf595bd348d1bca225 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-05-07[IMP] web: remove _lt from envAaron Bohy
Having _lt in the env doesn't make much sense, as it is useless at run time, and it would incite people to require 'web.env' to use it (at load time). The env should never be directly imported, it is automatically propagated from parents to children. To sum up, in Owl components: - when terms have to be translated at run time (e.g. in a function called when the user clicks on a button), the env is available and env._t must be used - when terms have to be translated at load time (e.g. a JS module defining a component with a translatable static property), one must require 'web.translation' and use function _lt it exports. closes odoo/odoo#50656 Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2020-01-31[FIX] web: do not deploy services twiceAaron Bohy
Since 671a5471cd891, services are deployed twice in the backend: once by the webclient (as it is a ServiceProvider), and once by the env (which now deploys the services to make them directly available for each Owl component of the component tree). As a consequence, some services perform twice some operations (e.g. the mail service fetches twice the /mail/init_messaging route, the crash manager service displays twice the tracebacks...). This commit fixes the issue by making the webclient directly use services from the env, instead of deploying them a second time. Part of 2183810 closes odoo/odoo#44301 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-01-21[IMP] web: Owl compatibility: add ComponentAdapterAaron Bohy
This commit adds the ComponentAdapter, an Owl component meant to be used as universal adapter for Owl components that embed Odoo legacy widgets. This component will be a precious tool during the transition phase of converting our JS codebase from the legacy (widget) framework to Owl.
2019-12-09[ADD] web: add owl 1.0.0-beta1 to odooGéry Debongnie
With this commit, we properly introduce the Owl library into our beloved codebase. More information on the Owl library can be found in the project repository: https://github.com/odoo/owl/ Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Julien Mougenot <jum@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>